I finally got my URL shortener working in Cloud9, but now I’m stuck trying to deploy to Heroku. For the previous API projects, I just chose Github as my deployment method and it was super easy.
Now I’ve tried the same approach and when my app launches the page just says “Application error: An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.”
Any suggestions for how to get through this? Does my Mongodb url need to be different from what it was in Cloud9?
Here’s all I’m getting from the logs: 2016-11-20T15:08:39.049274+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=my-urlshortener.herokuapp.com request_id=d2ba1850-c45c-4e00-aa5c-e05dd7e5da9d fwd="75.177.178.220" dyno= connect= service= status=503 bytes=
Not sure what you’re using for mongo with cloud 9 but Heroku is going to need an external service like mLab to work properly. Maybe that’s the issue? The log files you’ve posted don’t seem to be of much help
Also as an alternative to Heroku, Hyperdev is a lot better, in my opinion (although pushing directly from github doesn’t work nearly as well).
Also pretty sure I’ve pushed from Github to Heroku without procfile or app.json and it works fine. You do need to put your server js file (ie the entry to your application) as the “start” file in package.json though. That’s a very common mistake too.
Yeah, I don’t have app.json or procfile but have successfully pushed from Github to Heroku without them for the previous two API projects. I do have my server.js file as the start file.
Maybe I need to put a Procfile because i don’t use my labtop with cloud9, I just use a linux computer at home, Im going to look into this more later on, because i thought it was mandatory, I’m glad to learn something new in this chat. Thank you. happy coding!!