title: Vercel now server doesn't work with google spreadsheets
body: <p>I am trying to create a simple express server which adds some data to a google sheet when something is post requested on the link. Everything works locally but on now, the request works but it doesn't add data to the doc. <br></p>
  
  <p><strong>Index.js</strong></p>
  
  <pre><code>const express = require("express");
  const app = express();
  const cors = require("cors");
  const bodyParser = require("body-parser");
  const base64 = require("base-64");
  
  app.use(cors());
  const { GoogleSpreadsheet } = require("google-spreadsheet");
  const creds = require("./client_secret.json");
  const doc = new GoogleSpreadsheet(
    "11...."
  );
  
  async function accessSpreadsheet(depts, email) {
    await doc.useServiceAccountAuth({
      client_email: creds.client_email,
      private_key: creds.private_key,
    });
  
    await doc.loadInfo(); // loads document properties and worksheets
    console.log(doc.title);
    console.log(depts);
  
    const sheet = doc.sheetsByIndex[1];
    const rows = await sheet.getRows(); // or use doc.sheetsById[id]
    console.log(sheet.title);
    console.log(sheet.rowCount);
  
    await sheet.loadCells("B1:C500");
    depts.forEach((value) =&gt; {
      var a1 = sheet.getCell(value.id + 1, 2);
      a1.value += ", " + email;
    });
    sheet.saveUpdatedCells();
  }
  
  app.post(
    "/form/:email/",
    (req, res, next) =&gt; {
      const email = base64.decode(req.params.email);
      const depts = JSON.parse(req.query.array);
      accessSpreadsheet(depts, email);
      next();
    },
    (req, res) =&gt; {
      res.send(req.params + "success!");
    }
  );
  
  app.post("/form/", (req, res) =&gt; {
    res.send("please send post req");
  });
  
  app.get("/form/", (req, res) =&gt; {
    res.send("please send post req");
  });
  
  app.get("/", (req, res) =&gt; {
    res.send("e-Lite reg api");
  });
  app.listen(3000, () =&gt; console.log(`Example app listening on port ${3000}!`));
  </code></pre>
  
  <p><br>
  <strong>now.json</strong></p>
  
  <pre><code>{
    "version": 2,
    "builds": [{ "src": "index.js", "use": "@now/node-server" }],
    "routes": [
      {
        "src": "/",
        "dest": "/index.js",
        "methods": ["GET"]
      },
       {
         "src": "/form.*",
         "dest": "/index.js",
        "methods": ["GET", "POST"]
       }
    ]
  }
  
  </code></pre>
  
  <p>I dont think theres any problem with the code. It all works locally. Zeit doesn't report any errors with the API. </p>