Skip to content

Instantly share code, notes, and snippets.

@camnwalter
Created June 15, 2023 17:33
Show Gist options
  • Save camnwalter/9c051015d384bbc25af409ee2bd0516d to your computer and use it in GitHub Desktop.
Save camnwalter/9c051015d384bbc25af409ee2bd0516d to your computer and use it in GitHub Desktop.
Private Hypixel API Proxy
export default {
async fetch(request, env, ctx) {
const HYPIXEL_API = "https://api.hypixel.net";
const url = new URL(request.url);
return fetch(
`${HYPIXEL_API + url.pathname}?${url.searchParams}`,
{
headers: {
"API-Key": env.API_KEY,
},
}
);
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment