Skip to content

Instantly share code, notes, and snippets.

@ethndotsh
Created February 19, 2022 01:18
Show Gist options
  • Save ethndotsh/d5c8ee7834e40c9fbd994a1ee0a9b8fe to your computer and use it in GitHub Desktop.
Save ethndotsh/d5c8ee7834e40c9fbd994a1ee0a9b8fe to your computer and use it in GitHub Desktop.
Broken Noblox Next.js API Route
//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