Skip to content

Client side routing not working with React/Zeit Now #4099

Discussion options

You must be logged in to vote

Solved, missing static assets.

{
  "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": "^/static/(.*)", "dest": "web/static/$1" },
    { "src": "/(.*)", "dest": "web/index.html" }
  ]
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dborstelmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant