📜  从 yaml 文件加载招摇 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:11.155000             🧑  作者: Mango

代码示例1
const express = require('express');
const app = express();
const swaggerUi = require('swagger-ui-express');
const YAML = require('yamljs');
const swaggerDocument = YAML.load('./swagger.yaml');

app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));