aboutsummaryrefslogtreecommitdiff
path: root/src/app.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-05-29 14:48:50 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-05-29 14:53:08 -0700
commit548498d37424f2ac579770962b627aeba61925e8 (patch)
tree1d02f147b82dd8f9a48296f01a2ae2e84d71958c /src/app.ts
downloadchessh-bot-548498d37424f2ac579770962b627aeba61925e8.tar.gz
chessh-bot-548498d37424f2ac579770962b627aeba61925e8.zip
added bot
Diffstat (limited to 'src/app.ts')
-rw-r--r--src/app.ts24
1 files changed, 24 insertions, 0 deletions
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;