【m】增加swagger
This commit is contained in:
@@ -6,11 +6,12 @@ import signaling from './signaling';
|
||||
import { log, LogLevel } from './log';
|
||||
import Options from './class/options';
|
||||
import { reset as resetHandler }from './class/httphandler';
|
||||
import { initSwagger } from './swagger';
|
||||
|
||||
const cors = require('cors');
|
||||
|
||||
export const createServer = (config: Options): express.Application => {
|
||||
const app: express.Application = express();
|
||||
export const createServer = (config: Options): express.Express => {
|
||||
const app: express.Express = express();
|
||||
resetHandler(config.mode);
|
||||
// logging http access
|
||||
if (config.logging != "none") {
|
||||
@@ -35,5 +36,8 @@ export const createServer = (config: Options): express.Application => {
|
||||
}
|
||||
});
|
||||
});
|
||||
// 初始化Swagger
|
||||
initSwagger(app, config);
|
||||
|
||||
return app;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user