Ghost/core/server/api/canary/oembed.js
Aleksander Chromik df0d92f060
Replaced i18n.t w/ tpl in class OEmbed (#13492)
refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.

Co-authored-by: Aleksander Chromik <aleksander.chromik@footballco.com>
2021-10-08 15:32:16 +01:00

24 lines
570 B
JavaScript

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