From f0ca174ada81a0ec4b1bbff9b70fcc680e4ca0ad Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 29 May 2023 14:48:50 -0700 Subject: squash everything since there was profanity in the commit log and maybe people won't like that --- src/app.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/app.ts (limited to 'src/app.ts') diff --git a/src/app.ts b/src/app.ts new file mode 100644 index 0000000..7fc395f --- /dev/null +++ b/src/app.ts @@ -0,0 +1,24 @@ +import express from 'express'; +import morgan from 'morgan'; +import helmet from 'helmet'; +import cors from 'cors'; + +import * as middlewares from './middlewares'; +import api from './api'; + +import * as dotenv from 'dotenv'; +dotenv.config(); + +const app = express(); + +app.use(morgan('dev')); +app.use(helmet()); +app.use(cors()); +app.use(express.json()); + +app.use('/api', api); + +app.use(middlewares.notFound); +app.use(middlewares.errorHandler); + +export default app; -- cgit v1.2.3-70-g09d2