aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/index.ts b/src/index.ts
index ffa683e..3924c60 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -36,7 +36,7 @@ app.use((req, res, next) => {
const startTime = Date.now()
app.get('/', async (req, res) => {
const currentTime = Date.now()
- res.json({
+ let data: any = {
ok: true,
uptimeHours: (currentTime - startTime) / 1000 / 60 / 60,
finishedCachingRawLeaderboards,
@@ -50,8 +50,10 @@ app.get('/', async (req, res) => {
profileCacheSize: profileCache.keys().length,
profilesCacheSize: profilesCache.keys().length,
profileNameCacheSize: profileNameCache.keys().length,
- // key: getKeyUsage()
- })
+ }
+ if (req.headers.key === process.env.key)
+ data.key = getKeyUsage()
+ res.json()
})
app.get('/player/:user', async (req, res) => {