Quantcast
Channel: Node.jsタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8691

heroku: deploy next.js

$
0
0

deploy next.js app to heroku

terminal
# set up nextjs app
git clone https://.../your-nextjs-app.git

# add a new remote branch named as heroku which connects to the heroku servercd your-nextjs-app
heroku create

# create procfile (set command for heroku server to run app)
vim Procfile
Procfile
# YOU MUST SET PORT as $PORT, NOT a NUMBER LIKE 3000 or 8080. because heroku randomly assigns port nubmer to the deployed app 
npx next start -p$PORT
terminal
# deploy your app to heroku server
git push heroku 

# open page
heroku open

Viewing all articles
Browse latest Browse all 8691

Trending Articles