banner-data
This commit is contained in:
+6
-10
@@ -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, () => {
|
||||
|
||||
Reference in New Issue
Block a user