Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as Path from 'path';
import * as dotenv from 'dotenv';
import * as logger from 'morgan';
import * as express from 'express';
import * as bodyParser from 'body-parser';
import * as compression from 'compression';
dotenv.config({ path: '.env' });
import { ServerLoader, ServerSettings, GlobalAcceptMimesMiddleware } from 'ts-express-decorators';
import { $log } from 'ts-log-debug';
import { MongooseService } from './services/shared/mongoose.service';
const rootDir = Path.resolve(__dirname);
@ServerSettings({
rootDir,
mount: {
'/v1': `${rootDir}/controllers/**/**.controller.{ts,js}`
},
componentsScan: [
`${rootDir}/services/**/**.service.{ts,js}`,
`${rootDir}/middlewares/**/**.{ts,js}`,
`${rootDir}/dal/**/**.{ts,js}`
],
httpPort: process.env.PORT || 3000,
httpsPort: false,
acceptMimes: ['application/json'],
swagger: {
path: '/api-docs'
}
})