Client side routing not working with React/Zeit Now #4099
-
Background: I have a monorepo (for type safety) deployed with Zeit now. It's a graphql server using yoga deployed serverless to Now. It is also a static react app deployed through Now CDN. The below is the now.json I am using for it to work. The frontend app loads fine when you go to The problem: When you try to load a page in the app like I have tried numerous versions of rewrites and redirects and routes to no avail. Any know how to solve? {
"version": 2,
"env": {
"DATABASE_URL": "@database_url",
"NODE_ENV": "production"
},
"build": {
"env": {
"DATABASE_URL": "@database_url",
"NODE_ENV": "production"
}
},
"builds": [
{ "src": "api/index.ts", "use": "@now/node@canary" },
{
"src": "web/package.json",
"use": "@now/static-build",
"config": {
"distDir": "build"
}
}
],
"routes": [
{ "src": "/api", "dest": "api/index.ts" },
{ "src": "/(.*)", "dest": "web/$1" }
]
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solved, missing static assets.
|
Beta Was this translation helpful? Give feedback.
Solved, missing static assets.