mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
0bdaa216e5
- Ghost has a set of core packages that it is safe to require directly in any file - tpl is one of them! - This keeps the DI signature smaller and easier to reason about
24 lines
528 B
JavaScript
24 lines
528 B
JavaScript
const config = require('../../../shared/config');
|
|
const externalRequest = require('../../lib/request-external');
|
|
|
|
const OEmbed = require('../../services/oembed');
|
|
const oembed = new OEmbed({config, externalRequest});
|
|
|
|
module.exports = {
|
|
docName: 'oembed',
|
|
|
|
read: {
|
|
permissions: false,
|
|
data: [
|
|
'url',
|
|
'type'
|
|
],
|
|
options: [],
|
|
query({data}) {
|
|
let {url, type} = data;
|
|
|
|
return oembed.fetchOembedDataFromUrl(url, type);
|
|
}
|
|
}
|
|
};
|