Last active
April 3, 2017 08:52
-
-
Save mattiaerre/32cb87c726c7ecaa79f2a88b04508979 to your computer and use it in GitHub Desktop.
How to run a CRA in Heroku w/ Express and Node.js build pack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* info: the original "start" from CRA has been renamed to dev and a new "start" that points to server.js has been added */ | |
{ | |
"scripts": { | |
"start": "node server.js", | |
"dev": "react-scripts start", | |
"build": "react-scripts build", | |
"test": "react-scripts test --env=jsdom", | |
"eject": "react-scripts eject" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* author: Mattia Richetto | |
* twitter: @mattiaerre | |
* email: [email protected] | |
* date: 12/10/2016 | |
*/ | |
const express = require('express'); | |
const app = express(); | |
app.use(express.static('build')); | |
const port = process.env.PORT || 3000; | |
app.listen(port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment