aboutsummaryrefslogtreecommitdiff
path: root/src/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.ts')
-rw-r--r--src/server.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/server.ts b/src/server.ts
new file mode 100644
index 0000000..0368f99
--- /dev/null
+++ b/src/server.ts
@@ -0,0 +1,26 @@
+import express from 'express';
+import boardRouter from './routes/board';
+
+import swaggerUI from 'swagger-ui-express';
+import YAML from 'yamljs';
+const doc = YAML.load('src/files/SwaggerUI.yaml');
+
+import { InitPostgres, ClosePostgres } from './database/postgres';
+InitPostgres();
+
+const app = express();
+
+app.use(express.json());
+app.use(express.text());
+
+app.use('/swagger', swaggerUI.serve, swaggerUI.setup(doc));
+
+app.use('/', boardRouter);
+
+app.get('*', (req, res) => {
+ res.send("haha i ate your request");
+});
+
+app.listen(6969);
+
+// ClosePostgres();