Do you get any error logs when you run this at the command line:
heroku logs -t
Also, unrelated, but you need to hide your database username and password (and Google API keys) in a .env file and use the dotenv npm package if you are going to use a public git repo - anyone can currently access your database…
I just fixed that locally, tested locally, updated Github, re-deployed to Heroku, and rerean the app.’
Still getting Application Error
2017-10-15T20:25:05.997623+00:00 app[web.1]: npm ERR! node app.js
2017-10-15T20:25:05.997702+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-10-15T20:25:05.997785+00:00 app[web.1]: npm ERR! npm bugs urlshortener
2017-10-15T20:25:05.997904+00:00 app[web.1]: npm ERR! Or if that isn’t available, you can get their info via:
2017-10-15T20:25:05.997985+00:00 app[web.1]: npm ERR! npm owner ls urlshortener
2017-10-15T20:25:05.998071+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-10-15T20:25:06.001186+00:00 app[web.1]:
2017-10-15T20:25:06.001415+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-10-15T20:25:06.001482+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2017-10-15T20:25:06.067697+00:00 heroku[web.1]: Process exited with status 1
2017-10-15T20:25:06.084718+00:00 heroku[web.1]: State changed from starting to crashed
It’s just another version of the log command you’ve already run up above (it streams the output rather than giving you the last dump…you can run it in the background while you test things to see logs as they are generated)
OK, I just tried that, re-deployed the changes from Github to Heroku, then re-ran the app
Still got ‘Application Error’
earlier I did do a system restart so it is not a caching issue
2017-10-15T21:00:22.381654+00:00 heroku[web.1]: State changed from starting to crashed
2017-10-15T21:00:22.365627+00:00 heroku[web.1]: Process exited with status 1
2017-10-15T21:00:25.820046+00:00 heroku[run.1688]: State changed from up to complete
2017-10-15T21:00:25.805032+00:00 heroku[run.1688]: Process exited with status 127
2017-10-15T21:00:36.048398+00:00 app[api]: Starting process with command bash by user jesgillespie@gmail.com
2017-10-15T21:00:38.517883+00:00 heroku[run.7225]: Awaiting client
2017-10-15T21:00:38.550106+00:00 heroku[run.7225]: Starting process with command bash
2017-10-15T21:00:38.735404+00:00 heroku[run.7225]: State changed from starting to up
2017-10-15T21:00:58.834057+00:00 heroku[run.7225]: Client connection closed. Sending SIGHUP to all processes
2017-10-15T21:00:59.369922+00:00 heroku[run.7225]: State changed from up to complete
2017-10-15T21:00:59.356172+00:00 heroku[run.7225]: Process exited with status 127
2017-10-15T21:01:07.539284+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/favicon.ico" host=imgsrchabstrxlyer.herokuapp.com request_id=afc4dfab-10e5-47ff-953f-bae89dc5c412 fwd=“71.62.55.64” dyno= connect= service= status=503 bytes= protocol=https
2017-10-15T21:01:07.409520+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/" host=imgsrchabstrxlyer.herokuapp.com request_id=94130cd1-37e6-4654-8e30-bc42f38f5da0 fwd=“71.62.55.64” dyno= connect= service= status=503 bytes= protocol=https
You’re getting the GET / error again, so maybe the path.join thing I suggested was wrong (assuming you didn’t get that part of the error log prior to that change?)
I changed “index” back to “/index”. Also noticed in the scripts statement on the json package I have “node app.js” Changed that to “node app” ---- still getting error message when trying to view the app from Heroku
2017-10-15T21:09:09.454452+00:00 app[web.1]: npm ERR! npm bugs urlshortener
2017-10-15T21:09:09.454605+00:00 app[web.1]: npm ERR! Or if that isn’t available, you can get their info via:
2017-10-15T21:09:09.454702+00:00 app[web.1]: npm ERR! npm owner ls urlshortener
2017-10-15T21:09:09.454813+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-10-15T21:09:09.459069+00:00 app[web.1]:
2017-10-15T21:09:09.459285+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-10-15T21:09:09.459373+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2017-10-15T21:09:09.564157+00:00 heroku[web.1]: State changed from starting to crashed
2017-10-15T21:09:09.550130+00:00 heroku[web.1]: Process exited with status 1
2017-10-15T21:09:10.183404+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/" host=imgsrchabstrxlyer.herokuapp.com request_id=73a3b03e-7892-4a9d-a736-9c13201f60d5 fwd=“71.62.55.64” dyno= connect= service= status=503 bytes= protocol=https
2017-10-15T21:09:10.347527+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/favicon.ico" host=imgsrchabstrxlyer.herokuapp.com request_id=edd5bb57-b780-4004-89b8-34d2d04e7090 fwd=“71.62.55.64” dyno= connect= service= status=503 bytes= protocol=https
I am burning up google trying to figure this one out!