From 747097af03e422c72c2fe0065637e59a1685d219 Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 23 Oct 2022 21:34:48 +0300 Subject: nearly completed, forgot to make a repo --- src/server.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/server.ts (limited to 'src/server.ts') 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(); -- cgit v1.2.3