overhauled structure, leaderboardRoute.ts and userRoute.ts working
This commit is contained in:
parent
c2cd74ebe2
commit
fff55edf79
25 changed files with 315 additions and 212 deletions
|
|
@ -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`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue