red-coder-bh/src/main.ts

25 lines
436 B
TypeScript
Raw Normal View History

2022-04-14 20:55:52 +03:00
import express from 'express';
import { config } from 'dotenv';
import { errorHandle } from './utils/error-handling';
config();
const app = express();
2022-04-16 23:10:31 +03:00
const port = process.env.RED_CODER_BH_PORT;
2022-04-14 20:55:52 +03:00
app.get('/', (req, res) => {
res.send('hello')
})
app.get('/error', (req, res) => {
throw new Error('some mistake')
})
app.use(errorHandle);
app.listen(port, () => {
console.log(`listen on http://localhost:${port}`);
});