mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
24 lines
421 B
TypeScript
24 lines
421 B
TypeScript
/// <reference types="express" />
|
|
|
|
import * as express from '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);
|