cobyism / ghost-on-heroku

One-button Heroku deploy for the Ghost blogging platform.
MIT License
743 stars 686 forks source link

Change app's name by following the guide but it's still YOURAPPNAME.herokuapp.com #151

Closed bachdgvn closed 6 years ago

bachdgvn commented 6 years ago

I followed your guide to change YOURAPPNAME to my app's name. git clone https://github.com/cobyism/ghost-on-heroku cd ghost-on-heroku

heroku git:remote -a MYAPPNAME heroku info

I changed PUBLIC_URL.value in app.json then

git add . git commit -m "Important changes" git push heroku master

After heroku run update, it's still YOURAPPNAME.herokuapp.com. Did I edit wrong file?

markhillard commented 6 years ago

@bachdgvn, there's a file in the bin folder called create-config, which creates config.production.json during the build process using the config vars in your heroku app (process.env.PUBLIC_URL is one of them), so you don't need to update app.js.

All you need to do is login to your heroku account, open your app and then go to the Settings tab. Click Reveal Config Vars and then add an entry called PUBLIC_URL if it's not already there. This should be YOURAPPNAME.herokuapp.com (of course replace this with the full URL of your heroku app).

Hope this helps.

mars commented 6 years ago

Updating the app name is also possible via command line (CLI):

heroku config:set PUBLIC_URL=blog.example.com

The value must match your herokuapp.com built-in app name or a custom domain you’ve setup.