Last active
August 17, 2020 16:56
-
-
Save mathisGarberg/2c4041effb2fe603d007c8990346f303 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express require('express'); | |
| const swaggerUi = require('swagger-ui-express'); | |
| const swaggerDocument = require(docName); | |
| const app = express(); | |
| app.use('/doc', swaggerUi.server, swaggerUi.setup(swaggerDocument)); | |
| app.get('/', (req, res) => { | |
| res.send('Hello World'); | |
| }); | |
| const server = app.listen(8081, () => { | |
| var host = server.address().address; | |
| var port = server.address().port; | |
| console.log(`Example application listening on ${port}`; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment