0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/api/canary/oembed.js
Fabien egg O'Carroll c4021b6eb4 Added OpenSea API key to config
refs https://github.com/TryGhost/Team/issues/1237

We want to use an API key for OpenSea where possible so that we do not
run into rate limit issues.
2021-11-30 12:58:25 +02:00

30 lines
714 B
JavaScript

const config = require('../../../shared/config');
const externalRequest = require('../../lib/request-external');
const OEmbed = require('../../services/oembed');
const oembed = new OEmbed({config, externalRequest});
const NFT = require('../../services/nft-oembed');
const nft = new NFT({
config: {
apiKey: config.get('opensea').privateReadOnlyApiKey
}
});
oembed.registerProvider(nft);
module.exports = {
docName: 'oembed',
read: {
permissions: false,
data: [
'url',
'type'
],
options: [],
query({data}) {
let {url, type} = data;
return oembed.fetchOembedDataFromUrl(url, type);
}
}
};