【m】增加swagger

This commit is contained in:
2026-03-01 23:41:42 +08:00
parent f9037ca05d
commit c39dbfe8d5
11 changed files with 1205 additions and 104 deletions

View File

@@ -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;
};