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 you are subscribed to the OSS plan. > NOTE: You can use `now --public` or upgrade your plan (https://zeit.co/account/plan) to skip this prompt > Using Node.js 8.11.1 (default) > https://xxx.now.sh [in clipboard...