Skip to content

Instantly share code, notes, and snippets.

@mathisGarberg
Last active August 17, 2020 16:56
Show Gist options
  • Select an option

  • Save mathisGarberg/2c4041effb2fe603d007c8990346f303 to your computer and use it in GitHub Desktop.

Select an option

Save mathisGarberg/2c4041effb2fe603d007c8990346f303 to your computer and use it in GitHub Desktop.
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