I am new to Heroku and I'm attempting to deploy my node server and create-react-app front end application. Everything runs great locally but when I try to run it on Heroku it all goes down in flames. I get no deploy errors and I only see Cannot GET /
at my URL.
My logs say:
Something is already running on port 12345
/server/app.js
var express = require('express');
var app = express();
require('dotenv').config();
var mongoose = require('mongoose');
var config = require('./config');
var apiController = require('./controllers/apiController');
var port = process.env.PORT || 3005;
app.use('/', express.static(__dirname + '/public'));
app.set('view engine', 'ejs');
mongoose.connect(config.getDbConnectionString());
apiController(app);
app.listen(port);
package.json
{
"name": "happy-holidays",
"version": "1.0.0",
"description": "",
"engines": {
"node": "8.9.4"
},
"scripts": {
"start": "concurrently --kill-others-on-fail \"yarn run server\" \"yarn run client\"",
"server": "cd server && yarn start",
"client": "cd react-ui && yarn start"
},
"license": "UNLICENSED" ,
"cacheDirectories": [
"node_modules",
"react-ui/node_modules"
],
"dependencies": {
"@sendgrid/mail": "^6.2.1",
"axios": "^0.18.0",
"body-parser": "^1.18.2",
"bootstrap": "^4.1.1",
"concurrently": "^3.5.1",
"dotenv": "^5.0.1",
"ejs": "^2.6.1",
"express": "^4.16.3",
"mongoose": "^5.1.0",
"react": "^16.3.2",
"react-bootstrap": "^0.32.1",
"react-dom": "^16.3.2",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4",
"semantic-ui-css": "^2.3.1",
"semantic-ui-react": "^0.80.2"
},
"repository": {
"type": "git",
"url": "https://github.com/SaraRandolph/messagez"
},
"devDependencies": {}
}