banner-data

This commit is contained in:
2022-04-18 20:30:47 +03:00
parent bd6a846043
commit 2e159814e4
11 changed files with 140 additions and 15 deletions
+6 -10
View File
@@ -1,22 +1,18 @@
import express from 'express';
import { config } from 'dotenv';
import cookieSession from 'cookie-session';
import './config';
import { errorHandle } from './utils/error-handling';
config();
import { router } from './routes';
const app = express();
const port = process.env.RED_CODER_BH_PORT;
app.get('/', (req, res) => {
res.send('hello')
})
app.get('/error', (req, res) => {
throw new Error('some mistake')
})
app.use(express.json());
app.use(cookieSession({ secret: process.env.COOKIE_SESSION }));
app.use(router);
app.use(errorHandle);
app.listen(port, () => {