aboutsummaryrefslogtreecommitdiff
path: root/src/server.ts
blob: 0368f99f490f54c3cc17be7db245d23b3791000d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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();