Download the example or clone the repo:
curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/custom-server
cd custom-serverInstall it and run:
npm install
npm run devDeploy it to the cloud with now (download)
nowThis example demonstrates how to serve files such as /robots.txt and /sitemap.xml from the root.