I have looked through the forums to get help with the problem I am having. I get this error above and my app crashes on heroku. It seems to work fine locally. I read through the forums to see if there was a similar problem. Most people say that I have an issue with the local host and it should be set different. I am not sure what the write way to deploy this app should be and what I need to change. I tried to change the port. Or remove it and I was not able to do anything successfully. I have listed the server file below and followed heroku guidelines on their site. If I need to post more code I will but I am hoping someone could direct me. Thanks
.then(db.exists)
.then((isDbExists) => {
if (config.demomode) {
if (debugMode) {
if (!isDbExists) {
require('./scripts/mongorestore');
} else {
logger.debug('no database restore, it already exists');
}
} else {
require('./scripts/mongorestore');
}
}
const debug_http_port = 9091;
const app_http_port = process.env.LOCA_NODEJS_PORT || process.env.PORT || 8080;
const http_port = debugMode ? debug_http_port : app_http_port;
app.listen(http_port, function() {
logger.info('Listening port ' + http_port);
if (!debugMode) {
logger.info('In production mode');
} else {
logger.info('In development mode (no minify/no uglify)');
}
if (config.demomode) {
logger.info('In demo mode (login disabled)');
}
const configdir = process.env.LOCA_CONFIG_DIR || process.env.CONFIG_DIR || path.join(__dirname, 'config');
logger.debug('loaded configuration from', configdir);
logger.debug(JSON.stringify(config, null, 1));
if (debugMode) {
const browserSync = require('browser-sync');
browserSync.init({
proxy: `localhost:${debug_http_port}`,
files: ['dist'],
port: app_http_port,
weinre: {
port: 8080
},
open: false
});
}
});
})
.catch((err) => {
logger.error(err);
process.exit(1);});```