Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public config(): void {
// use json form parser middlware
this.app.use(bodyParser.json());
// use query string parser middlware
this.app.use(
bodyParser.urlencoded({
extended: false,
}),
);
this.app.use(swagger.express(
{
definition: {
externalDocs: {
url: 'Typescript Seed URL'
},
info: {
title: 'Typescript Seed API',
version: '1.0'
}
}
}
));
}
server.setConfig((app: any) => {
app.use('/api-docs/swagger', express.static('swagger'));
app.use(
'/api-docs/swagger/assets',
express.static('node_modules/swagger-ui-dist')
);
app.use(bodyParser.json());
app.use(
swagger.express({
definition: {
info: {
title: 'My api',
version: '1.0',
},
models: {
ApiError: {
properties: {
code: {
type:
SwaggerDefinitionConstant.Model.Property
.Type.STRING,
example: ['400'],
},
message: {
type: