mirror of
https://github.com/discordjs/discord.js.git
synced 2026-05-21 02:40:07 +00:00
* chore: move proxy-container to apps * chore: limit next/react rules to next apps * chore: add standalone issue template --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
14 lines
508 B
TypeScript
14 lines
508 B
TypeScript
import { createServer } from 'node:http';
|
|
import process from 'node:process';
|
|
import { proxyRequests } from '@discordjs/proxy';
|
|
import { REST } from '@discordjs/rest';
|
|
|
|
process.on('SIGINT', () => process.exit(0));
|
|
|
|
// We want to let upstream handle retrying
|
|
const api = new REST({ rejectOnRateLimit: () => true, retries: 0 });
|
|
const server = createServer(proxyRequests(api));
|
|
|
|
const port = Number.parseInt(process.env.PORT ?? '8080', 10);
|
|
server.listen(port, () => console.log(`Listening on port ${port}`));
|