简体   繁体   中英

App is deployed to heroku but returns a server error

I have my application working perfectly when I run it locally. However, once it was deployed to Heroku, the server stopped returning the data and returns a 500 code. All of my code can be found here and the live application (not functioning) is here .

EDIT: Here are the heroku logs:

2021-03-06T04:00:59.416851+00:00 heroku[router]: at=info method=GET path="/" host=fast-shore-66611.herokuapp.com request_id=0a279e6e-c6d0-4bf8-ac4d-45d85c914e4a fwd="174.45.175.167" 
dyno=web.1 connect=1ms service=50ms status=200 bytes=1401 protocol=https
2021-03-06T04:00:59.672729+00:00 heroku[router]: at=info method=GET path="/js/app.71b734f2.js" host=fast-shore-66611.herokuapp.com request_id=68509950-00e2-4f0d-84ea-3a96cf0dcbc1 fwd="174.45.175.167" dyno=web.1 connect=1ms service=21ms status=200 bytes=62457 protocol=https2021-03-06T04:01:00.023258+00:00 heroku[router]: at=info method=GET path="/css/app.badeae52.css" host=fast-shore-66611.herokuapp.com request_id=603ee68a-bc30-4c7e-8177-3e3c0f3fa712 fwd="174.45.175.167" dyno=web.1 connect=0ms service=22ms status=200 bytes=3523 protocol=https
2021-03-06T04:01:00.035863+00:00 heroku[router]: at=info method=GET path="/js/chunk-vendors.e9c4f783.js" host=fast-shore-66611.herokuapp.com request_id=8e857b3a-b40d-4ad8-a1aa-cb8dc6d3b15a fwd="174.45.175.167" dyno=web.1 connect=0ms service=39ms status=200 bytes=501256 protocol=https
2021-03-06T04:01:04.003747+00:00 heroku[router]: at=info method=GET path="/result/tyler" host=fast-shore-66611.herokuapp.com request_id=45020e4f-61d5-419d-9a51-f61ccb06b257 fwd="174.45.175.167" dyno=web.1 connect=0ms service=21ms status=500 bytes=284 protocol=https        
2021-03-06T04:01:08.110920+00:00 heroku[router]: at=info method=GET path="/result/henderson" host=fast-shore-66611.herokuapp.com request_id=e9f739c3-36cb-4d3e-a480-e93d0784ea66 fwd="174.45.175.167" dyno=web.1 connect=0ms service=17ms status=500 bytes=284 protocol=https    
2021-03-06T04:01:33.000000+00:00 app[api]: Build started by user reaganclayton1995@gmail.com
2021-03-06T04:01:38.112111+00:00 heroku[router]: at=info method=GET path="/result/tyler" host=fast-shore-66611.herokuapp.com request_id=f8a0dd9a-a033-430a-8249-6f433b6066a5 fwd="174.45.175.167" dyno=web.1 connect=0ms service=45ms status=500 bytes=284 protocol=https        
2021-03-06T04:01:40.977816+00:00 heroku[router]: at=info method=GET path="/result/tyler" host=fast-shore-66611.herokuapp.com request_id=305a750b-8ca6-486c-9cee-a7b9b3e64891 fwd="174.45.175.167" dyno=web.1 connect=0ms service=9ms status=500 bytes=284 protocol=https
2021-03-06T04:01:46.859981+00:00 heroku[router]: at=info method=GET path="/" host=fast-shore-66611.herokuapp.com request_id=738c1e2e-ed83-4fef-86e3-52813667b798 fwd="174.45.175.167" 
dyno=web.1 connect=0ms service=3ms status=304 bytes=269 protocol=https
2021-03-06T04:01:47.095156+00:00 heroku[router]: at=info method=GET path="/js/app.71b734f2.js" host=fast-shore-66611.herokuapp.com request_id=aa992042-2411-439d-b982-e180501f2e07 fwd="174.45.175.167" dyno=web.1 connect=1ms service=8ms status=304 bytes=270 protocol=https   
2021-03-06T04:01:47.101684+00:00 heroku[router]: at=info method=GET path="/css/app.badeae52.css" host=fast-shore-66611.herokuapp.com request_id=aad26a97-869d-450b-9d14-b1deac43a470 fwd="174.45.175.167" dyno=web.1 connect=0ms service=30ms status=200 bytes=3523 protocol=https
2021-03-06T04:01:47.157018+00:00 heroku[router]: at=info method=GET path="/js/chunk-vendors.e9c4f783.js" host=fast-shore-66611.herokuapp.com request_id=4eb14331-e0c3-4127-b691-0f036cca30a4 fwd="174.45.175.167" dyno=web.1 connect=0ms service=59ms status=304 bytes=271 protocol=https
2021-03-06T04:02:07.327105+00:00 app[api]: Deploy 36a0a5b6 by user reaganclayton1995@gmail.com
2021-03-06T04:02:07.327105+00:00 app[api]: Release v10 created by user reaganclayton1995@gmail.com
2021-03-06T04:02:07.516033+00:00 heroku[web.1]: Restarting
2021-03-06T04:02:07.541614+00:00 heroku[web.1]: State changed from up to starting
2021-03-06T04:02:08.000000+00:00 app[api]: Build succeeded
2021-03-06T04:02:09.003004+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-03-06T04:02:09.247345+00:00 heroku[web.1]: Process exited with status 143
2021-03-06T04:02:09.633378+00:00 heroku[web.1]: Starting process with command `npm start`
2021-03-06T04:02:12.908565+00:00 app[web.1]: 
2021-03-06T04:02:12.908594+00:00 app[web.1]: > weatherup@1.0.0 start
2021-03-06T04:02:12.908594+00:00 app[web.1]: > node server
2021-03-06T04:02:12.908595+00:00 app[web.1]: 
2021-03-06T04:02:13.113839+00:00 app[web.1]: Server running in production mode on port 39626
2021-03-06T04:02:13.917299+00:00 heroku[web.1]: State changed from starting to up
2021-03-06T04:09:34.447563+00:00 heroku[router]: at=info method=GET path="/" host=fast-shore-66611.herokuapp.com request_id=b591ded0-7f1a-4c14-a1e2-7f856a2e45aa fwd="54.164.83.156" dyno=web.1 connect=1ms service=24ms status=200 bytes=1401 protocol=https
2021-03-06T04:10:06.594714+00:00 heroku[router]: at=info method=HEAD path="/" host=fast-shore-66611.herokuapp.com request_id=b063d8b0-d361-40a2-a0e8-85b2ac937292 fwd="217.182.175.162" dyno=web.1 connect=0ms service=2ms status=200 bytes=321 protocol=https
2021-03-06T04:11:00.259797+00:00 heroku[router]: at=info method=GET path="/result/tyler" host=fast-shore-66611.herokuapp.com request_id=216b9449-8ad7-4bf4-8780-99d3db9ea0c0 fwd="174.45.175.167" dyno=web.1 connect=1ms service=7ms status=500 bytes=284 protocol=https
2021-03-06T04:11:03.661150+00:00 heroku[router]: at=info method=GET path="/result/henderson" host=fast-shore-66611.herokuapp.com request_id=9b656dd6-dccc-4271-a507-2181e358193d fwd="174.45.175.167" dyno=web.1 connect=1ms service=3ms status=500 bytes=284 protocol=https     

EDIT 2: It turns out that I had my config.env added to my .gitignore , so my server didn't have access to my environment variables to make the API call. Now I am wondering if taking it out of the .gitignore is going to allow users to access the file, which is what I don't want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM