UNPKG

488 BJavaScriptView Raw
1const path = require('path');
2const express = require('express');
3const serveStatic = require('serve-static');
4const swaggerUi = require('swagger-ui-dist');
5const config = require('./config');
6
7module.exports = (callback) => {
8 const app = express();
9
10 app.use('/docs', serveStatic(path.resolve(__dirname)));
11
12 app.use(serveStatic(swaggerUi.getAbsoluteFSPath()));
13
14 app.listen(config.port, () => {
15 console.log('Listening on port %d', config.port);
16
17 callback(config);
18 });
19};