我确实在heroku上部署了一个节点应用程序。当我去app2.herokuapp.com
或去app2.herokuapp.com / api
时,一切正常。问题是当我转到app2.herokuapp.com / api / users
时。我得到一个错误。下面是来自Heroku的日志。
2019-12-03T21:01:43.314626+00:00 app[api]: Initial release by user xxxx
2019-12-03T21:01:43.314626+00:00 app[api]: Release v1 created by user xxxx
2019-12-03T21:01:43.594782+00:00 app[api]: Enable Logplex by user xxxx
2019-12-03T21:01:43.594782+00:00 app[api]: Release v2 created by user xxxx
2019-12-03T21:03:04.000000+00:00 app[api]: Build started by user xxxx
2019-12-03T21:03:19.752034+00:00 app[api]: Release v3 created by user xxxx
2019-12-03T21:03:19.767153+00:00 app[api]: Scaled to web@1:Free by user xxxx
2019-12-03T21:03:19.752034+00:00 app[api]: Deploy 23444554 by user xxxx
2019-12-03T21:03:20.000000+00:00 app[api]: Build succeeded
2019-12-03T21:03:22.529262+00:00 heroku[web.1]: Starting process with command `npm start`
2019-12-03T21:03:25.640201+00:00 app[web.1]:
2019-12-03T21:03:25.640222+00:00 app[web.1]: > api@1.0.0 start /app
2019-12-03T21:03:25.640225+00:00 app[web.1]: > node app.js
2019-12-03T21:03:25.640227+00:00 app[web.1]:
2019-12-03T21:03:26.504034+00:00 app[web.1]: Db connected successfully
2019-12-03T21:03:26.512112+00:00 app[web.1]: Running App on port 40290
2019-12-03T21:03:27.109926+00:00 heroku[web.1]: State changed from starting to up
2019-12-03T21:03:37.675815+00:00 heroku[router]: at=info method=GET path="/" host=app2.herokuapp.com request_id=vcvcvcvrt445a fwd="134.111.111.116" dyno=web.1 connect=0ms service=45ms status=200 bytes=224 protocol=https
2019-12-03T21:03:38.054369+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=app2.herokuapp.com request_id=dfdfdfdfdfdfdf354 fwd="134.111.111.116" dyno=web.1 connect=0ms service=26ms status=404 bytes=394 protocol=https
2019-12-03T21:03:56.503735+00:00 app[web.1]: handle error here: Server selection timed out after 30000 ms
2019-12-03T21:04:16.545136+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/api/users" host=app2-app2.herokuapp.com request_id=dfdfdfdfdf554535 fwd="134.111.111.116" dyno=web.1 connect=1ms service=30001ms status=503 bytes=0 protocol=https
2019-12-03T21:10:57.467222+00:00 heroku[router]: at=info method=GET path="/" host=app2.herokuapp.com request_id=ghhfghhfhghggh fwd="134.111.111.116" dyno=web.1 connect=1ms service=2ms status=304 bytes=150 protocol=https
2019-12-03T21:11:41.646803+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/api/users" host=app2.herokuapp.com request_id=5355tffftreffref fwd="134.111.111.116" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https