Skip to content

Commit 09e155d

Browse files
committed
Switch to Heroku Node.js auto-build
1 parent 440b1b2 commit 09e155d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ A combo of two npm projects, the backend server and the frontend UI. So there ar
1616
* [deployed automatically](https://devcenter.heroku.com/categories/deployment) via heroku/nodejs buildpack
1717
2. [**React UI**](react-ui/): [`react-ui/package.json`](react-ui/package.json)
1818
* generated by [create-react-app](https://github.com/facebookincubator/create-react-app)
19-
* deployed via build hooks in the Node server's [`./package.json`](package.json)
20-
* module cache configured by `cacheDirectories`
21-
* bundling via `heroku-postbuild` hook
19+
* deployed via `build` script in the Node server's [`./package.json`](package.json)
20+
* module cache configured by `cacheDirectories`
2221

2322
Includes a minimal [Node Cluster](https://nodejs.org/docs/latest-v8.x/api/cluster.html) [implementation](server/index.js) to parallelize the single-threaded Node process across the available CPU cores.
2423

@@ -41,7 +40,7 @@ This deployment will automatically:
4140
* detect [Node buildpack](https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-nodejs)
4241
* build the app with
4342
* `npm install` for the Node server
44-
* `heroku-postbuild` for create-react-app
43+
* `npm run build` for create-react-app
4544
* launch the web process with `npm start`
4645
* serves `../react-ui/build/` as static files
4746
* customize by adding API, proxy, or route handlers/redirectors

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "heroku-cra-node",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "How to use create-react-app with a custom Node API on Heroku",
55
"engines": {
66
"node": "10.x"
77
},
88
"scripts": {
99
"start": "node server",
10-
"heroku-postbuild": "cd react-ui/ && npm install && npm install --only=dev --no-shrinkwrap && npm run build"
10+
"build": "cd react-ui/ && npm install && npm install --only=dev --no-shrinkwrap && npm run build"
1111
},
1212
"cacheDirectories": [
1313
"node_modules",

0 commit comments

Comments
 (0)