mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
chore: move proxy-container to apps (#11435)
* 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>
This commit is contained in:
13
apps/proxy-container/src/index.ts
Normal file
13
apps/proxy-container/src/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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}`));
|
||||
Reference in New Issue
Block a user