aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-04-08 14:17:40 -0500
committermat <27899617+mat-1@users.noreply.github.com>2021-04-08 14:17:40 -0500
commit541731a63c5e05baa58dd6fcb598c14dd4ce9d88 (patch)
treee901127694d2398d8e68697fc3b557dfe14b04d6 /src/index.ts
parentddefc69df40827fe04902ab2da4baa4da3db96d5 (diff)
downloadskyblock-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.ts10
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)