Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku deployment #54

Open
ranleung opened this issue Apr 16, 2017 · 1 comment
Open

Heroku deployment #54

ranleung opened this issue Apr 16, 2017 · 1 comment

Comments

@ranleung
Copy link

ranleung commented Apr 16, 2017

Just started working on this starter.

How do you push this to heroku?
Do I have to create a prod-sever.js and configure there and then use that in a newly created Procfile? Are there any other set ups i need to do? Here is my current prod-server.js.

const express = require('express');
const path = require('path');
const port = process.env.PORT || 8080;

const app = express();

app.use(express.static('build'));

app.get('*', (req, res) => {
  res.sendFile(path.join(__dirname, 'build/client/index.html'));
});

app.listen(port, () => {
  console.log("Party started on port "+port);
})

Thanks

@edcolcode
Copy link

I used this template to start with a new application. To work with heroku I added some additional scripts in the package.json:

"preheroku-postbuild": "npm run clean:build", "heroku-postbuild": "webpack --config ./config/webpack.config.production.js --progress", "postheroku-postbuild": "npm run build:html", "heroku-serve": "http-server build/client -p ${PORT:=3003} --cors"

Also I added this buildpack to the heroku application settings
heroku/nodejs

Currently I'm looking to update the server since it only works with the root page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants