title: Trying to deplay react and express to vercel but I keep getting code not found
body: <p>I tried to deploy MERN application to Vercel but I keep getting the code not found error. I did looked over the <a href="https://vercel.com/guides/using-express-with-vercel" rel="nofollow noreferrer">documentation</a> and still couldn't figure out what the problem is.
  Any help is appreciate it!</p>
  <p>This is what my app structure looks like:</p>
  <pre><code>root/main
      client
        +build
        +node_modules
        +public
        +src
        +package-lock.json
        +package.json
  
       server
        +api (this is where the product route are. controller funtions)
        +config
        +conrtoller
        +models
        +server.js
        +node_modules
        +package-lock.json
        +package.json
       verce.json
      .gitignore
  
       
  </code></pre>
  <p>This is what server.js looks like:</p>
  <pre><code>require(&quot;dotenv&quot;).config;
  const express = require(&quot;express&quot;);
  var cors = require(&quot;cors&quot;);
  var logger = require(&quot;morgan&quot;);
  var path = require(&quot;path&quot;);
  const connectDB = require(&quot;./server/config/db&quot;);
  
  const productsRoute = require(&quot;./api/productsRoute&quot;);
  
  const app = express();
  app.use(cors());
  app.use(express.json());
  app.use(logger(&quot;dev&quot;));
  app.use(express.urlencoded({ extended: false }));
  const PORT = process.env.PORT || 5000;
  
  connectDB();
  
  app.use(&quot;/api/products&quot;, productsRoute);
  
  app.use(&quot;/api&quot;, require(path.join(__dirname, &quot;./api/productsRoute.js&quot;)));
  
  app.use(express.static(path.join(__dirname, &quot;../client/build&quot;)));
  app.get(&quot;*&quot;, function (_, res) {
     res.sendFile(
        path.join(__dirname, &quot;../client/build/index.html&quot;),
        function (err) {
           if (err) {
              res.status(500).send(err);
           }
        }
     );
  });
  
  app.listen(PORT, () =&gt; console.log(&quot;server is connected&quot;));
  module.exports = app;
  </code></pre>
  <p>This is waht verce.json looks like:</p>
  <pre><code>{
     &quot;version&quot;: 2,
     &quot;builds&quot;: [
        {
           &quot;src&quot;: &quot;./server/server.js&quot;,
           &quot;use&quot;: &quot;@vercel/node&quot;
        },
        {
           &quot;src&quot;: &quot;./client/build&quot;,
           &quot;use&quot;: &quot;@vercel/static&quot;
        }
     ],
  
     &quot;rewrites&quot;: [
        {
           &quot;source&quot;: &quot;/(.*)&quot;,
           &quot;destination&quot;: &quot;./server/server.js&quot;
        }
     ]
  }
  </code></pre>