4

I want to deploy a project that includes a React App as frontend (client/) and an Express API backend (api/) on vercel. I'm able to deploy the api but how can I deploy also the client?

My project structure:

-api/
  -package.json
  -index.js
-client/
  -package.json
  -public/...
  -src/...
-vercel.json

My current vercel.json:

{
  "version": 2,
  "builds": [
    {
      "src": "./api/index.js",
      "use": "@vercel/node"
    },

    // that is what I tried but it's not working:
    {
      "src": "./client/package.json",
      "use": "@vercel/static-build"
    }
    // End of the non-functional code  
  ],
  "routes": [
    {
      "src": "api/.*",
      "dest": "api/index.js"
    },

    // that is what I tried but it's not working:
    {
      "src": "client/build/static/.*",
      "dest": "static/.*"
    },
    {
      "src": "client/build/index.html",
      "dest": "index.html"
    }
    // End of the non-functional code  
  ]
}
Berliner95
  • 63
  • 1
  • 5

0 Answers0