Deploying to Now.sh

Heroku is a well known workhorse, but nowadays there are newer players that can do things even easier, for example, Now.sh.

In addition to the previous example, just add one more script with the now-specific name now-start to package.json:

// package.json{  "scripts": {    "heroku-postbuild": "npm run build",    "build": "next build",    "start": "next",    "server": "next start",    "now-start": "npm run server",    "test": "NODE_ENV=test jest"  }}

Then, install Now Desktop from their website, register/login, and run this:

$ now

That will produce something like this:

$ now> Your credentials and configuration were migrated to "~/.now"> Deploying ~/Sites/next-test under xxx> Your deployment's code and logs will be publicly accessible because ...

Get Next.js Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.