Sunday, 5 August 2018

Trouble deploying to Heroku

Hey all! I'm trying to deploy my first Node app to Heroku. Everything was going great up until my last commit, now it's giving my trouble.In adding in tests, I must've changed how the app is deployed. It has something to do with http vs https requests. I know this because I have a line in my layout.pug (below). When I comment it out, my app works (on my machine), but my images (loaded with http) give me warnings in the console. When I leave it in, my code breaks. (Error code, Chrome: This site can’t be reached. localhost unexpectedly closed the connection. ERR_CONNECTION_CLOSED). In Heroku it's similar, (2018-08-05T17:57:36.358085+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=iss-weather-app.herokuapp.com request_id=19c4ff6b-3b76-4e9f-b6d6-d6a988d5e69d fwd="73.94.0.7" dyno= connect= service= status=503 bytes= protocol=https)meta(http-equiv="Content-Security-Policy" content="upgrade-insecure-requests") This line is present in the version I have deployed so it's just a symptom, not the cause. I have a feeling it has something to do with process.env.NODE_ENV which is a variable I added for my tests, but I'm not really sure. Any ideas would be appreciated!Master branch (working) and 'tests' branch (not) can be found here in my GitHub.

Submitted August 05, 2018 at 08:06PM by TJaySteno1

No comments:

Post a Comment