aboutsummaryrefslogtreecommitdiff
path: root/build/index.js
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-02-28 01:35:46 -0600
committermat <27899617+mat-1@users.noreply.github.com>2021-02-28 01:35:46 -0600
commit5bf261102017e6489af9b604a3a60cc8083c97d7 (patch)
treef1896edd1a44f5f09a7727f67b89a5295196f039 /build/index.js
parentce7bd034cd5bd763c01674055ea88203bf806744 (diff)
parent3fb0c21c294a4ff02353e5726d5ef1c21c39cb0d (diff)
downloadskyblock-api-5bf261102017e6489af9b604a3a60cc8083c97d7.tar.gz
skyblock-api-5bf261102017e6489af9b604a3a60cc8083c97d7.tar.bz2
skyblock-api-5bf261102017e6489af9b604a3a60cc8083c97d7.zip
Merge branch 'main' of https://github.com/skyblockstats/skyblock-api into main
Diffstat (limited to 'build/index.js')
-rw-r--r--build/index.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/build/index.js b/build/index.js
index 3174e69..52e711c 100644
--- a/build/index.js
+++ b/build/index.js
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.debug = void 0;
const hypixel_1 = require("./hypixel");
const express_1 = __importDefault(require("express"));
+const database_1 = require("./database");
const app = express_1.default();
-exports.debug = true;
+exports.debug = false;
app.use((req, res, next) => {
if (process.env.key && req.headers.key !== process.env.key)
// if a key is set in process.env and the header doesn't match return an error
@@ -24,4 +25,7 @@ app.get('/player/:user', async (req, res) => {
app.get('/player/:user/:profile', async (req, res) => {
res.json(await hypixel_1.fetchMemberProfile(req.params.user, req.params.profile));
});
+app.get('/leaderboard/:name', async (req, res) => {
+ res.json(await database_1.fetchMemberLeaderboard(req.params.name));
+});
app.listen(8080, () => console.log('App started :)'));