aboutsummaryrefslogtreecommitdiff
path: root/build/index.js
blob: bfc8b8d856ce5aa0bcdf1815b2bcea0d186a7122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = __importDefault(require("express"));
const hypixel_1 = require("./hypixel");
const app = express_1.default();
app.get('/', async (req, res) => {
    res.json({ ok: true });
});
app.get('/player/:user', async (req, res) => {
    res.json(await hypixel_1.fetchUser({ user: req.params.user }, ['profiles', 'player']));
});
app.get('/player/:user/:profile', async (req, res) => {
    res.json(await hypixel_1.fetchMemberProfile(req.params.user, req.params.profile));
});
app.listen(8080, () => console.log('App started :)'));