mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-04 21:19:53 +08:00
22 lines
387 B
TypeScript
22 lines
387 B
TypeScript
import express = require('express');
|
|
import swaggerJSDoc = require('swagger-jsdoc');
|
|
const app = express();
|
|
|
|
let options = {
|
|
swaggerDefinition: {
|
|
info: {
|
|
title: 'A test api',
|
|
version: '1.0.0'
|
|
}
|
|
}
|
|
};
|
|
|
|
|
|
let swaggerSpec = swaggerJSDoc(options);
|
|
|
|
app.get('/api-docs.json', function(req, res) {
|
|
res.send(swaggerSpec);
|
|
})
|
|
|
|
app.listen(8888);
|