---
title: Deploy on heroku
tags: App Hosting
---
# Deploy on heroku
**for [devconnector_project](https://github.com/barrystone/dev-social-network-community)**
0. login heroku in terminal =>(heroku login)
1. Create a [production.json] copy from [default.json]
(or you want different database etc… and changing)
2. add
"scripts": {
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install -—prefix client && npm run build —-prefix client"
},
in root [package.json]
3. add
const path = require("path");
// Serve static assets in production
if (process.env.NODE_ENV == "production") {
// Set static folder
app.use(express.static("client/build”));x
app.get("*", (req, res) => {
res.sendFile(path.resolve(__dirname, "client", "build", "index.html"));
});
}
in [sever,js]
4. start to deploy
in terminal
1. => `heroku create`
2. remember ``git add .`` and commit
3. go to your new app you just created find [deploy] tap click
login use terminal =>`heroku login`
and copy to terminal => `heroku git:remote -a <Your-App-Domain>`
or `git remote heroku add heroku <Heroku git URI>` not sure yet
4. => `git push heroku master`
5. DONE!! =>`heroku open`