aboutsummaryrefslogtreecommitdiff
path: root/vnext/server/middleware/oembed.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/server/middleware/oembed.js')
-rw-r--r--vnext/server/middleware/oembed.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/vnext/server/middleware/oembed.js b/vnext/server/middleware/oembed.js
index 8b1ed61d..5d062228 100644
--- a/vnext/server/middleware/oembed.js
+++ b/vnext/server/middleware/oembed.js
@@ -1,19 +1,19 @@
-import { embeddedTweet } from '../../src/api';
+import { embeddedTweet } from '../../src/api'
/**
* Return content for embedding
* @type {import('express').RequestParamHandler}
*/
const oembed = async (req, res) => {
- let url = (req.query.url || '').toString();
+ let url = (req.query.url || '').toString()
return embeddedTweet(url).then(result => {
- res.send(result);
- res.end();
+ res.send(result)
+ res.end()
}).catch(err => {
- console.log(`HTTP ${err.response ? err.response.status : err.code}: ${url}`);
- res.sendStatus(err.response ? err.response.status : 500);
- res.end();
- });
-};
+ console.log(`HTTP ${err.response ? err.response.status : err.code}: ${url}`)
+ res.sendStatus(err.response ? err.response.status : 500)
+ res.end()
+ })
+}
-export default oembed;
+export default oembed