Because the api and app are in two different folders I am having a lot of issues deploying this app to heroku. What I have done so far is make a package.json at the root and Im using npm concurrently to run these commands:
"scripts": {
"app": "cd app && source ../env.sh; webpack --watch --progress",
"api": "cd api && source ../env.sh; nodemon",
"www": "cd app && source ../env.sh; npm start",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "concurrently \"npm run api\" \"npm run app\" \"npm run www\""
},
> [email protected] start /app
> concurrently "npm run api" "npm run app" "npm run www"
[1]
[1] > [email protected] app /app
[1] > cd app && source ../env.sh; webpack --watch --progress
[1]
[1] sh: 1: source: not found
[0]
[0] > [email protected] api /app
[0] > cd api && source ../env.sh; nodemon
[0]
[0] sh: 1: source: not found
[0] sh: 1: nodemon: not found
[0] npm ERR! file sh
[0] npm ERR! code ELIFECYCLE
[0] npm ERR! errno ENOENT
[0] npm ERR! syscall spawn
[0] npm ERR! [email protected] api: `cd api && source ../env.sh; nodemon`
[0] npm ERR! spawn ENOENT
[0] npm ERR!
[0] npm ERR! Failed at the [email protected] api script.
[0] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[0]
[0] npm ERR! A complete log of this run can be found in:
[0] npm ERR! /app/.npm/_logs/2018-02-17T22_48_01_788Z-debug.log
[2]
[2] > [email protected] www /app
[2] > cd app && source ../env.sh; npm start
[2]
[2] sh: 1: source: not found
[0] npm run api exited with code 1
[2]
[2] > [email protected] start /app/app
[2] > node ./bin/www
[2]
[1] You tried to inline "JWT_SECRET", but it is not defined.
[1] You tried to inline "DB_USERNAME", but it is not defined.
[1] You tried to inline "DB_HOST", but it is not defined.
[1] You tried to inline "DB_PASSWORD", but it is not defined.
[1] You tried to inline "DB_PORT", but it is not defined.
[1] You tried to inline "MAPBOX_ACCESS_TOKEN", but it is not defined.
[1] You tried to inline "S3_KEY", but it is not defined.
[1] You tried to inline "S3_SECRET", but it is not defined.
[1] You tried to inline "S3_BUCKET", but it is not defined.
[1] You tried to inline "STREAM_APP_ID", but it is not defined.
[1] You tried to inline "STREAM_KEY", but it is not defined.
[1] You tried to inline "STREAM_SECRET", but it is not defined.
[1] You tried to inline "ALGOLIA_APP_ID", but it is not defined.
[1] You tried to inline "ALGOLIA_SEARCH_ONLY_KEY", but it is not defined.
[1] You tried to inline "ALGOLIA_API_KEY", but it is not defined.
[1] You tried to inline "KEEN_PROJECT_ID", but it is not defined.
[1] You tried to inline "KEEN_WRITE_KEY", but it is not defined.
[1] You tried to inline "KEEN_READ_KEY", but it is not defined.
[1] You tried to inline "IMGIX_BASE_URL", but it is not defined.
[1] You tried to inline "API_URL", but it is not defined.
[1] You tried to inline "JWT_SECRET", but it is not defined.
[1] You tried to inline "DB_USERNAME", but it is not defined.
[1] You tried to inline "DB_HOST", but it is not defined.
[1] You tried to inline "DB_PASSWORD", but it is not defined.
[1] You tried to inline "DB_PORT", but it is not defined.
[1] You tried to inline "MAPBOX_ACCESS_TOKEN", but it is not defined.
[1] You tried to inline "S3_KEY", but it is not defined.
[1] You tried to inline "S3_SECRET", but it is not defined.
[1] You tried to inline "S3_BUCKET", but it is not defined.
[1] You tried to inline "STREAM_APP_ID", but it is not defined.
[1] You tried to inline "STREAM_KEY", but it is not defined.
[1] You tried to inline "STREAM_SECRET", but it is not defined.
[1] You tried to inline "ALGOLIA_APP_ID", but it is not defined.
[1] You tried to inline "ALGOLIA_SEARCH_ONLY_KEY", but it is not defined.
[1] You tried to inline "ALGOLIA_API_KEY", but it is not defined.
[1] You tried to inline "KEEN_PROJECT_ID", but it is not defined.
[1] You tried to inline "KEEN_WRITE_KEY", but it is not defined.
[1] You tried to inline "KEEN_READ_KEY", but it is not defined.
[1] You tried to inline "IMGIX_BASE_URL", but it is not defined.
[1] You tried to inline "API_URL", but it is not defined.
[1] 10% building modules 1/1 modules 0 active
[1] Webpack is watching the files...
[1]
Hash: fb514be0ca7735ac8d98 s [1] Version: webpack 3.11.0
[1] Time: 28100ms
[1] Asset Size Chunks Chunk Names
[1] ./public/js/app.js 2.22 MB 0 [emitted] [big] app
[1] ./public/css/styles.min.css 23 kB 0 [emitted] app
[1] [10] ./config.js 613 bytes {0} [built]
[1] [154] ./modules/main.js 3.09 kB {0} [built]
[1] [379] multi ./modules/main.js 28 bytes {0} [built]
[1] [697] ./modules/routes/Landing/index.js 247 bytes {0} [built]
[1] [699] ./modules/routes/Home/index.js 436 bytes {0} [built]
[1] [703] ./modules/routes/Upload/index.js 245 bytes {0} [built]
[1] [705] ./modules/routes/Search/index.js 706 bytes {0} [built]
[1] [709] ./modules/routes/SearchResults/index.js 1.27 kB {0} [built]
[1] [713] ./modules/routes/Explore/index.js 709 bytes {0} [built]
[1] [715] ./modules/routes/Trending/index.js 1.15 kB {0} [built]
[1] [717] ./modules/routes/Profile/index.js 1.15 kB {0} [built]
[1] [721] ./modules/routes/FollowingActivity/index.js 1.31 kB {0} [built]
[1] [723] ./modules/routes/Stats/index.js 1.29 kB {0} [built]
[1] [725] ./modules/routes/Contributions/index.js 1.3 kB {0} [built]
[1] [727] ./modules/routes/Location/index.js 936 bytes {0} [built]
[1] + 714 hidden modules
[1]
[1] ERROR in ./public/js/app.js from UglifyJs
[1] Unexpected character '`' [./public/js/app.js:64514,41]
[1] Child extract-text-webpack-plugin ../node_modules/extract-text-webpack-plugin/dist ../node_modules/css-loader/index.js!../node_modules/sass-loader/lib/loader.js!modules/style.css:
[1] [0] ../node_modules/css-loader!../node_modules/sass-loader/lib/loader.js!./modules/style.css 23.8 kB {0} [built]
[1] + 1 hidden module
[1] Child extract-text-webpack-plugin ../node_modules/extract-text-webpack-plugin/dist ../node_modules/css-loader/index.js!../n