Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Heroku deployment #54

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

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.

@nicksp nicksp closed this as completed Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants