diff options
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/index.ts b/src/index.ts index adeab57..0c33930 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ import { fetchMemberProfile, fetchUser } from './hypixel' import express from 'express' +import { fetchMemberLeaderboard } from './database' const app = express() @@ -33,4 +34,11 @@ app.get('/player/:user/:profile', async(req, res) => { ) }) +app.get('/leaderboard/:name', async(req, res) => { + res.json( + await fetchMemberLeaderboard(req.params.name) + ) +}) + + app.listen(8080, () => console.log('App started :)')) |