support POST to /oembed too

main
Mike Fix 6 years ago
parent 05f476d363
commit 491091d0ef

@ -17,6 +17,8 @@ module.exports = (req, res) => {
try { try {
embedUrl = decodeURIComponent(req.query.url) embedUrl = decodeURIComponent(req.query.url)
} catch (e) { } catch (e) {
// eslint-disable-next-line
console.log(e)
/* URL is already decoded */ /* URL is already decoded */
} }

@ -55,7 +55,7 @@ puppeteer.launch(puppeteerParams).then(browser => {
server.post('/image', bodyParser.json({ limit: '5mb' }), wrap(imageHandler)) server.post('/image', bodyParser.json({ limit: '5mb' }), wrap(imageHandler))
server.get('/unsplash/random', wrap(unsplashHandler.randomImages)) server.get('/unsplash/random', wrap(unsplashHandler.randomImages))
server.get('/unsplash/download/:imageId', wrap(unsplashHandler.downloadImage)) server.get('/unsplash/download/:imageId', wrap(unsplashHandler.downloadImage))
server.get('/oembed', oembedHandler) server.all('/oembed', oembedHandler)
server.listen(port, '0.0.0.0', err => { server.listen(port, '0.0.0.0', err => {
if (err) throw err if (err) throw err

Loading…
Cancel
Save