Hoe to get rid of the warning bodyParser is deprecated. (deprecation)tslint(1)
I don't really want to disable next line, is there a better way?
This is my index.ts
import { app } from './app';
import * as dotenv from 'dotenv';
dotenv.config();
const hostname = process.env.HOST;
const port = process.env.PORT;
app.listen(port, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
and this is app.ts
import express, { Application } from 'express';
import bodyParser from 'body-parser';
import { routes } from './routes';
export const app: Application = express();
app.use(bodyParser.json()); // bodyParser is deprecated. (deprecation)tslint(1)
routes(app);