aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts
index 1d75830..59e7761 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,4 +1,4 @@
-import { createSession, fetchAccountFromDiscord, fetchAllLeaderboardsCategorized, fetchLeaderboard, fetchMemberLeaderboardSpots, fetchSession, finishedCachingRawLeaderboards, leaderboardUpdateMemberQueue, leaderboardUpdateProfileQueue, updateAccount, deleteSession } from './database.js'
+import { createSession, fetchAccountFromDiscord, fetchAllLeaderboardsCategorized, fetchLeaderboard, fetchMemberLeaderboardSpots, fetchSession, finishedCachingRawLeaderboards, leaderboardUpdateMemberQueue, leaderboardUpdateProfileQueue, updateAccount, deleteSession, fetchPaginatedItemsAuctions } from './database.js'
import { fetchElection, fetchItemList, fetchMemberProfile, fetchUser } from './hypixel.js'
import rateLimit from 'express-rate-limit'
import * as constants from './constants.js'
@@ -164,6 +164,20 @@ app.get('/items', async (req, res) => {
}
})
+
+app.get('/auctionprices', async (req, res) => {
+ try {
+ res
+ .setHeader('Cache-Control', 'public, max-age=600')
+ .json(
+ await fetchPaginatedItemsAuctions(0, 100)
+ )
+ } catch (err) {
+ console.error(err)
+ res.json({ ok: false })
+ }
+})
+
app.post('/accounts/createsession', async (req, res) => {
try {
const { code } = req.body