overhauled structure, leaderboardRoute.ts and userRoute.ts working

This commit is contained in:
j-weissen 2022-12-28 15:39:58 +01:00
parent c2cd74ebe2
commit fff55edf79
25 changed files with 315 additions and 212 deletions

View file

@ -10,10 +10,14 @@ const port = 3000
app.use(helmet())
// configure & use logger
let morganFormatted = morgan('[:date[iso]] :method :url - :status')
app.use(morganFormatted);
app.use(express.json())
app.use('/leaderboard', leaderboardRoute)
app.use('/user', userRoute)
@ -21,6 +25,10 @@ app.get('/helloworld', (req, res) => {
res.json({message: "Hello World!"})
})
app.post('/echo', async (req, res) => {
res.json(req.body)
})
app.listen(port, () => {
console.log(`Server started at http://localhost:3000`);