diff options
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/index.ts b/src/index.ts index 0d66c55..451ef95 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ +import { fetchAllLeaderboardsCategorized, fetchMemberLeaderboard, fetchMemberLeaderboardSpots } from './database' import { fetchMemberProfile, fetchUser } from './hypixel' -import express from 'express' -import { fetchAllLeaderboardsCategorized, fetchMemberLeaderboard } from './database' import rateLimit from 'express-rate-limit' +import express from 'express' const app = express() @@ -40,6 +40,12 @@ app.get('/player/:user/:profile', async(req, res) => { ) }) +app.get('/player/:user/:profile/leaderboards', async(req, res) => { + res.json( + await fetchMemberLeaderboardSpots(req.params.user, req.params.profile) + ) +}) + app.get('/leaderboard/:name', async(req, res) => { res.json( await fetchMemberLeaderboard(req.params.name) |