diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-04-08 14:17:40 -0500 |
---|---|---|
committer | mat <27899617+mat-1@users.noreply.github.com> | 2021-04-08 14:17:40 -0500 |
commit | 541731a63c5e05baa58dd6fcb598c14dd4ce9d88 (patch) | |
tree | e901127694d2398d8e68697fc3b557dfe14b04d6 /src/index.ts | |
parent | ddefc69df40827fe04902ab2da4baa4da3db96d5 (diff) | |
download | skyblock-api-541731a63c5e05baa58dd6fcb598c14dd4ce9d88.tar.gz skyblock-api-541731a63c5e05baa58dd6fcb598c14dd4ce9d88.tar.bz2 skyblock-api-541731a63c5e05baa58dd6fcb598c14dd4ce9d88.zip |
add member leaderboard spots api
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) |