title: NextJS with Firebase Cloud Functions
body: <p>I want use NextJS with firebase cloud functions and I am creating a cloud function:</p>
  
  <pre><code>import * as functions from 'firebase-functions';
  import cors from 'cors';
  import express from 'express';
  import next from 'next';
  
  const nextApp = next({ dev: false });
  const handle = nextApp.getRequestHandler();
  
  nextApp
    .prepare()
    .then(() =&gt; {
      const server = express();
      server.use(cors({ origin: true }));
  
      server.get('/a', (req, res) =&gt; {
        return nextApp.render(req, res, '/b', req.query);
      });
  
      server.get('/b', (req, res) =&gt; {
        return nextApp.render(req, res, '/a', req.query);
      });
  
      server.get('*', (req, res) =&gt; {
        return handle(req, res);
      });
    })
    .catch(ex =&gt; {
      console.error(ex.stack);
      process.exit(1);
    });
  
  export let app = functions.https.onRequest(nextApp);
  </code></pre>
  
  <p>NextJS create a folder with the build of my JS app.</p>
  
  <p>The problem is that I can't upload on the cloud the NextJS build folder.
  How I can include this folder?</p>
  
  <p>GitHub Issue => <a href="https://github.com/zeit/next.js/issues/2017" rel="nofollow noreferrer">https://github.com/zeit/next.js/issues/2017</a></p>