Created
February 19, 2022 01:18
-
-
Save ethndotsh/d5c8ee7834e40c9fbd994a1ee0a9b8fe to your computer and use it in GitHub Desktop.
Broken Noblox Next.js API Route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//pages/api/proxy/get-by-username/[username].js | |
import noblox from "noblox.js"; | |
export default async function handler(req, res) { | |
const { username } = req.query; | |
const id = await noblox.getIdFromUsername(username); | |
const user = await noblox.getPlayerInfo(1); | |
return res.json({ id, ...user }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment