diff options
author | kartofen <mladenovnasko0@gmail.com> | 2022-10-23 21:34:48 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2022-10-23 21:34:48 +0300 |
commit | 747097af03e422c72c2fe0065637e59a1685d219 (patch) | |
tree | 6b965e4c5d4ee812d104c3537866f2e3b5e27376 /src/server.ts |
nearly completed, forgot to make a repo
Diffstat (limited to 'src/server.ts')
-rw-r--r-- | src/server.ts | 26 |
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(); |