mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
refactor(proxy): rely on auth header instead (#9422)
* refactor(proxy): rely on auth header instead * chore: typo * chore: language Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> * chore: more language Co-authored-by: Aura Román <kyradiscord@gmail.com> * chore: more language nitpicks Co-authored-by: ckohen <chaikohen@gmail.com> * fix: unnecessary async --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: Aura Román <kyradiscord@gmail.com> Co-authored-by: ckohen <chaikohen@gmail.com>
This commit is contained in:
@@ -3,12 +3,8 @@ import process from 'node:process';
|
||||
import { proxyRequests } from '@discordjs/proxy';
|
||||
import { REST } from '@discordjs/rest';
|
||||
|
||||
if (!process.env.DISCORD_TOKEN) {
|
||||
throw new Error('A DISCORD_TOKEN env var is required');
|
||||
}
|
||||
|
||||
// We want to let upstream handle retrying
|
||||
const api = new REST({ rejectOnRateLimit: () => true, retries: 0 }).setToken(process.env.DISCORD_TOKEN);
|
||||
const api = new REST({ rejectOnRateLimit: () => true, retries: 0 });
|
||||
const server = createServer(proxyRequests(api));
|
||||
|
||||
const port = Number.parseInt(process.env.PORT ?? '8080', 10);
|
||||
|
||||
Reference in New Issue
Block a user