Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: vercel rewrites #1619

Open
wants to merge 5 commits into
base: source
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { glob } from "glob"
import { updateCodeData } from "./scripts/update-code-data/update-code-data"
import { organizeCodeData } from "./scripts/update-code-data/organize-code-data"
import { sortCodeData } from "./scripts/update-code-data/sort-code-data"
import redirects from "./redirects.json"

require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
Expand Down Expand Up @@ -38,7 +37,8 @@ export const onCreateNode: GatsbyNode["onCreateNode"] = async ({
createNodeId,
createContentDigest,
}) => {
const { createNode, createParentChildLink, createRedirect } = actions
const { createNode, createParentChildLink } = actions


// Derive content nodes from remark nodes
if (
Expand Down
17 changes: 9 additions & 8 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"redirects": [
"rewrites": [
{
"source": "/conf/attendee/:path*",
"destination": "https://graphql-conf-attendee-nextjs.vercel.app/:path*",
"statusCode": 200
"destination": "https://graphql-conf-attendee-nextjs.vercel.app/:path*"
},
{
"source": "/swapi-graphql/:path*",
"destination": "https://graphql.github.io/swapi-graphql/:path*"
}
],
"redirects": [
{
"source": "/conf/program",
"destination": "/conf/schedule",
Expand All @@ -15,11 +20,7 @@
"destination": "/conf/sessions/:path*",
"permanent": false
},
{
"source": "/swapi-graphql/:path*",
"destination": "https://graphql.github.io/swapi-graphql/:path*",
"statusCode": 200
},

{
"source": "/docs/api-reference-errors",
"destination": "/graphql-js/error/",
Expand Down