From ce50035082a89d35eeab09378024c69509a626b8 Mon Sep 17 00:00:00 2001 From: Govorunb Date: Sun, 16 Jun 2024 06:36:25 +1000 Subject: [PATCH] endpoint to get user info --- ebs/src/index.ts | 1 + ebs/src/modules/twitch.ts | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 ebs/src/modules/twitch.ts diff --git a/ebs/src/index.ts b/ebs/src/index.ts index d25d1b7..8eb6c8a 100644 --- a/ebs/src/index.ts +++ b/ebs/src/index.ts @@ -30,6 +30,7 @@ async function main() { require("./modules/config"); require("./modules/transactions"); require("./modules/game"); + require("./modules/twitch"); const { setIngame } = require("./modules/config"); diff --git a/ebs/src/modules/twitch.ts b/ebs/src/modules/twitch.ts new file mode 100644 index 0000000..1dd63a5 --- /dev/null +++ b/ebs/src/modules/twitch.ts @@ -0,0 +1,7 @@ +import { app } from ".."; +import { asyncCatch } from "../util/middleware"; +import { getHelixUser } from "../util/twitch"; + +app.get("/private/user/:id", asyncCatch(async (req, res) => { + res.json(await getHelixUser(req.params["id"])); +}));