summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-17 10:18:17 +0100
committerRory& <root@rory.gay>2025-12-17 10:18:17 +0100
commite008c9947e9b8e4191e3cc4026d2b49ae784e252 (patch)
tree29fd0d0579773915c4d8b59c7cb3bd582ba1fba8 /src/api
parentRemove GATEWAY/CDN env variables in favor of single source of truth (diff)
downloadserver-ts-e008c9947e9b8e4191e3cc4026d2b49ae784e252.tar.xz
No more fallback URLs
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/channels/#channel_id/webhooks.ts3
-rw-r--r--src/api/routes/webhooks/#webhook_id/#token/index.ts3
-rw-r--r--src/api/routes/webhooks/#webhook_id/index.ts3
3 files changed, 3 insertions, 6 deletions
diff --git a/src/api/routes/channels/#channel_id/webhooks.ts b/src/api/routes/channels/#channel_id/webhooks.ts

index 106d8442..9d226b19 100644 --- a/src/api/routes/channels/#channel_id/webhooks.ts +++ b/src/api/routes/channels/#channel_id/webhooks.ts
@@ -43,11 +43,10 @@ router.get( relations: ["user", "channel", "source_channel", "guild", "source_guild", "application"], }); - const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001"; return res.json( webhooks.map((webhook) => ({ ...webhook, - url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, + url: Config.get().api.endpointPublic + "/webhooks/" + webhook.id + "/" + webhook.token, })), ); }, diff --git a/src/api/routes/webhooks/#webhook_id/#token/index.ts b/src/api/routes/webhooks/#webhook_id/#token/index.ts
index 18902ac0..1b589a7b 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/index.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/index.ts
@@ -35,10 +35,9 @@ router.get( throw DiscordApiErrors.INVALID_WEBHOOK_TOKEN_PROVIDED; } - const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001"; return res.json({ ...webhook, - url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, + url: Config.get().api.endpointPublic + "/webhooks/" + webhook.id + "/" + webhook.token, }); }, ); diff --git a/src/api/routes/webhooks/#webhook_id/index.ts b/src/api/routes/webhooks/#webhook_id/index.ts
index 3a0dfe53..9c0a6418 100644 --- a/src/api/routes/webhooks/#webhook_id/index.ts +++ b/src/api/routes/webhooks/#webhook_id/index.ts
@@ -29,10 +29,9 @@ router.get( if (!permission.has("MANAGE_WEBHOOKS")) throw DiscordApiErrors.UNKNOWN_WEBHOOK; } else if (webhook.user_id != req.user_id) throw DiscordApiErrors.UNKNOWN_WEBHOOK; - const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001"; return res.json({ ...webhook, - url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, + url: Config.get().api.endpointPublic + "/webhooks/" + webhook.id + "/" + webhook.token, }); }, );