📜  swagger js npm - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:12.478000             🧑  作者: Mango

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

var options = {
  customCss: '.swagger-ui .topbar { display: none }'
};

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