From 09e155d625ab3adb662b9be099b5a5a6492df17c Mon Sep 17 00:00:00 2001 From: Mars Hall Date: Mon, 1 Apr 2019 15:30:25 -0700 Subject: [PATCH] Switch to Heroku Node.js auto-build --- README.md | 7 +++---- package.json | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8a93c8c..ab0765b 100755 --- a/README.md +++ b/README.md @@ -16,9 +16,8 @@ A combo of two npm projects, the backend server and the frontend UI. So there ar * [deployed automatically](https://devcenter.heroku.com/categories/deployment) via heroku/nodejs buildpack 2. [**React UI**](react-ui/): [`react-ui/package.json`](react-ui/package.json) * generated by [create-react-app](https://github.com/facebookincubator/create-react-app) - * deployed via build hooks in the Node server's [`./package.json`](package.json) - * module cache configured by `cacheDirectories` - * bundling via `heroku-postbuild` hook + * deployed via `build` script in the Node server's [`./package.json`](package.json) + * module cache configured by `cacheDirectories` 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. @@ -41,7 +40,7 @@ This deployment will automatically: * detect [Node buildpack](https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-nodejs) * build the app with * `npm install` for the Node server - * `heroku-postbuild` for create-react-app + * `npm run build` for create-react-app * launch the web process with `npm start` * serves `../react-ui/build/` as static files * customize by adding API, proxy, or route handlers/redirectors diff --git a/package.json b/package.json index 33b3909..9e57540 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "heroku-cra-node", - "version": "1.0.0", + "version": "2.0.0", "description": "How to use create-react-app with a custom Node API on Heroku", "engines": { "node": "10.x" }, "scripts": { "start": "node server", - "heroku-postbuild": "cd react-ui/ && npm install && npm install --only=dev --no-shrinkwrap && npm run build" + "build": "cd react-ui/ && npm install && npm install --only=dev --no-shrinkwrap && npm run build" }, "cacheDirectories": [ "node_modules",