From fe0bda37b437a997f9d2faa073b021130b371e35 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sat, 21 Dec 2024 19:06:16 -0500 Subject: [PATCH] use netlify redirect for discord route --- CONTRIBUTING.md | 2 ++ netlify.toml | 3 ++- src/pages/api/discord.js | 8 -------- 3 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 src/pages/api/discord.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7233926d..a39fe022 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -313,3 +313,5 @@ See the [Greenwood Storybook docs](/guides/ecosystem/storybook/#content-as-data) ## Hosting and Deployment This project is hosted on Netlify and automatically deploys on each merge into main. Release branches will be curated over the course of a Greenwood release cycle and then merged at the time the new Greenwood release is published to NPM. + +For links to `/discord/`, a redirect is configured in _netlify.toml_ to redirect these requests to the project's Discord server. diff --git a/netlify.toml b/netlify.toml index c0404aa1..2f572ab6 100644 --- a/netlify.toml +++ b/netlify.toml @@ -13,5 +13,6 @@ to = "/about/tech-stack/" [[redirects]] + status = 302 from = "/discord/" - to = "/api/discord" \ No newline at end of file + to = "https://discord.gg/dmDmjFCKuH" \ No newline at end of file diff --git a/src/pages/api/discord.js b/src/pages/api/discord.js deleted file mode 100644 index dcc4326b..00000000 --- a/src/pages/api/discord.js +++ /dev/null @@ -1,8 +0,0 @@ -export function handler() { - return new Response("", { - status: 301, - headers: { - Location: "https://discord.gg/dmDmjFCKuH", - }, - }); -}