Skip to content

Commit

Permalink
Better vercel routes
Browse files Browse the repository at this point in the history
  • Loading branch information
VasylMarchuk committed Feb 12, 2025
1 parent 4f74e59 commit bfa62fa
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,29 @@
"buildCommand": "npm run build:vercel:dist && npm run build:vercel:functions",
"installCommand": "npm install --no-fund --no-audit",
"rewrites": [
{ "source": "/prerender-user-profile-page", "destination": "/404" },
{
"source": "/package.json",
"destination": "/404",
"comment": "Disallow accessing /package.json"
},
{
"source": "/prerender-user-profile-page",
"destination": "/404",
"comment": "Disallow accessing prerender-user-profile-page serverless function directly"
},
{ "source": "/submissions", "destination": "https://backend.codecrafters.io/submissions" },
{ "source": "/submissions/:match*", "destination": "https://backend.codecrafters.io/submissions/:match*" },
{ "source": "/progress/:match*", "destination": "https://backend.codecrafters.io/progress/:match*" },
{ "source": "/users/:username", "destination": "/prerender-user-profile-page" },
{ "source": "/:path*", "destination": "/_empty.html" }
{
"source": "/users/:username",
"destination": "/prerender-user-profile-page",
"comment": "Rewrite user profile pages to prerender-user-profile-page serverless function"
},
{
"source": "/:path*",
"destination": "/_empty.html",
"comment": "Rewrite everything else to /_empty.html"
}
],
"redirects": [
{
Expand All @@ -25,10 +42,6 @@
{
"source": "/setup_team",
"destination": "https://backend.codecrafters.io/setup_team"
},
{
"source": "/package.json",
"destination": "/"
}
],
"github": {
Expand Down

0 comments on commit bfa62fa

Please sign in to comment.