diff options
author | Vitaly Takmazov | 2023-07-02 08:22:55 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-07-02 08:42:12 +0300 |
commit | ec805392cbb2e91b107e0203b250db6ba08644ba (patch) | |
tree | c301a4e818852169c23a98d6f57cf69e0e3b679a /bridge/index.js | |
parent | 813d37ff165f4bfb130529663ae7a2290053a604 (diff) |
bridge: slimmed-down oembed server
Diffstat (limited to 'bridge/index.js')
-rw-r--r-- | bridge/index.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bridge/index.js b/bridge/index.js new file mode 100644 index 00000000..8369f803 --- /dev/null +++ b/bridge/index.js @@ -0,0 +1,25 @@ +import express from 'express' +import { raw } from 'body-parser' +import cors from 'cors' +import debug from 'debug' +const log = debug('http') + +import oembed from '../vnext/server/middleware/oembed' + +const app = express() +app.use(raw()) +app.use(cors()) +const router = express.Router() + +router.get('/api/oembed', oembed) + +app.use(router) + +const PORT = 8081 +// start the app +app.listen(PORT, (error) => { + if (error) { + return console.log('something bad happened', error) + } + log('listening on ' + PORT + '...') +}) |