我创建了一个NodeJS服务器项目API,从Web平台https://mlab.com/
调用数据库当我尝试localhost http://localhost:3050/api/drivers?city=Taitung&lng=121.148208&lat=22.75194时,我也可以测试API
但是当我将NodeJS项目部署到Heroku时 http://obscure-reaches-65656.herokuapp.com/api/drivers?city=Taitung&lng=121.148208&lat=22.75194
我在终端上输入命令heroku logs --tail
以查看日志:
2018-03-18T06:05:08.375804+00:00 app[api]: Initial release by user motogod19@gmail.com
2018-03-18T06:05:08.471066+00:00 app[api]: Enable Logplex by user motogod19@gmail.com
2018-03-18T06:05:08.375804+00:00 app[api]: Release v1 created by user motogod19@gmail.com
2018-03-18T06:05:08.471066+00:00 app[api]: Release v2 created by user motogod19@gmail.com
2018-03-18T06:06:19.000000+00:00 app[api]: Build started by user motogod19@gmail.com
2018-03-18T06:06:30.616894+00:00 app[api]: Deploy d3c40901 by user motogod19@gmail.com
2018-03-18T06:06:30.616894+00:00 app[api]: Release v3 created by user motogod19@gmail.com
2018-03-18T06:06:30.637145+00:00 app[api]: Scaled to web@1:Free by user motogod19@gmail.com
2018-03-18T06:06:19.000000+00:00 app[api]: Build succeeded
2018-03-18T06:06:33.712703+00:00 heroku[web.1]: Starting process with command `npm start`
2018-03-18T06:06:36.852130+00:00 heroku[web.1]: Process exited with status 1
2018-03-18T06:06:36.930031+00:00 heroku[web.1]: State changed from starting to crashed
2018-03-18T06:06:36.932312+00:00 heroku[web.1]: State changed from crashed to starting
2018-03-18T06:06:36.732169+00:00 app[web.1]: npm ERR! missing script: start
2018-03-18T06:06:36.756380+00:00 app[web.1]:
2018-03-18T06:06:36.756689+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-03-18T06:06:36.756834+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-03-18T06_06_36_734Z-debug.log
2018-03-18T06:06:39.126953+00:00 heroku[web.1]: Starting process with command `npm start`
2018-03-18T06:06:41.039218+00:00 app[web.1]: npm ERR! missing script: start
2018-03-18T06:06:41.046870+00:00 app[web.1]:
2018-03-18T06:06:41.047052+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-03-18T06:06:41.047140+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-03-18T06_06_41_040Z-debug.log
2018-03-18T06:06:41.097345+00:00 heroku[web.1]: Process exited with status 1
2018-03-18T06:06:41.212482+00:00 heroku[web.1]: State changed from starting to crashed
2018-03-18T06:08:28.192546+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api?city=Tainan" host=obscure-reaches-65656.herokuapp.com request_id=ac243fb5-8cff-4d25-9bf8-2300bab65366 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:09:07.193035+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/drivers?city=Taitung&lng=121.148208&lat=22.75194" host=obscure-reaches-65656.herokuapp.com request_id=dec95f07-8e62-4ef0-9281-761272a8f8d8 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:09:14.021136+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/api/drivers?city=Taitung&lng=121.148208&lat=22.75194" host=obscure-reaches-65656.herokuapp.com request_id=c4370865-ef95-4be7-b080-0ab147cb8343 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:09:18.336520+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/drivers?city=Taitung&lng=121.148208&lat=22.75194" host=obscure-reaches-65656.herokuapp.com request_id=c5159a28-4ac6-454d-88b7-c0b2c9655722 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:13:28.018009+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/drivers?city=Taitung&lng=121.148208&lat=22.75194" host=obscure-reaches-65656.herokuapp.com request_id=785b4cb8-b6af-4fab-b4bd-98612d5ce3a6 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:21:56.000000+00:00 app[api]: Build started by user motogod19@gmail.com
2018-03-18T06:22:08.546919+00:00 heroku[web.1]: State changed from crashed to starting
2018-03-18T06:22:07.921688+00:00 app[api]: Release v4 created by user motogod19@gmail.com
2018-03-18T06:21:56.000000+00:00 app[api]: Build succeeded
2018-03-18T06:22:07.921688+00:00 app[api]: Deploy a8b1544a by user motogod19@gmail.com
2018-03-18T06:22:10.573705+00:00 heroku[web.1]: Starting process with command `npm start`
2018-03-18T06:22:12.363700+00:00 app[web.1]: npm ERR! missing script: start
2018-03-18T06:22:12.369804+00:00 app[web.1]:
2018-03-18T06:22:12.369988+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-03-18T06:22:12.370055+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-03-18T06_22_12_364Z-debug.log
2018-03-18T06:22:12.435432+00:00 heroku[web.1]: State changed from starting to crashed
2018-03-18T06:22:12.438213+00:00 heroku[web.1]: State changed from crashed to starting
2018-03-18T06:22:12.420994+00:00 heroku[web.1]: Process exited with status 1
2018-03-18T06:22:14.949982+00:00 heroku[web.1]: Starting process with command `npm start`
2018-03-18T06:22:17.213549+00:00 heroku[web.1]: Process exited with status 1
2018-03-18T06:22:17.148941+00:00 app[web.1]: npm ERR! missing script: start
2018-03-18T06:22:17.156922+00:00 app[web.1]:
2018-03-18T06:22:17.157109+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-03-18T06:22:17.157196+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-03-18T06_22_17_151Z-debug.log
2018-03-18T06:22:17.225932+00:00 heroku[web.1]: State changed from starting to crashed
2018-03-18T06:23:48.538506+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/drivers?city=Taitung&lng=121.148208&lat=22.75194" host=obscure-reaches-65656.herokuapp.com request_id=c932f235-6ae4-4c2a-a979-ec0520415f79 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:24:40.788894+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api" host=obscure-reaches-65656.herokuapp.com request_id=7e17f8d7-9306-419f-aa4a-57fec234e90b fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:25:41.393055+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-reaches-65656.herokuapp.com request_id=6bb7d55a-3599-4c2c-b682-da2b08455f1e fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:25:41.779869+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-reaches-65656.herokuapp.com request_id=34636c62-e249-4d9b-9245-96b30c9baa84 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:26:54.962996+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=obscure-reaches-65656.herokuapp.com request_id=293dfb57-bfbc-4e1c-b1d5-077e46e75ecf fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:26:55.259215+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-reaches-65656.herokuapp.com request_id=de8ae98c-6514-49bb-9022-54942f1f9473 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=https
2018-03-18T06:27:14.417706+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api" host=obscure-reaches-65656.herokuapp.com request_id=8481b756-9a45-4af6-91a5-fd5050238760 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=http
2018-03-18T06:27:48.876668+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api" host=obscure-reaches-65656.herokuapp.com request_id=1b46d5d5-05f3-45f2-882c-3a1de4cbc1fb fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=http
2018-03-18T06:27:49.343983+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-reaches-65656.herokuapp.com request_id=5755ddd4-47f3-4e8b-8618-6d32b019a215 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=http
2018-03-18T06:31:09.713454+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/drivers?city=Taitung&lng=121.148208&lat=22.75194" host=obscure-reaches-65656.herokuapp.com request_id=de0e7b55-a5eb-4260-b169-9cc514da36a6 fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=http
2018-03-18T06:31:09.997798+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=obscure-reaches-65656.herokuapp.com request_id=2378e844-8d24-4aaa-9d48-278995fa129d fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=http
2018-03-18T06:38:00.011732+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/drivers?city=Taitung&lng=121.148208&lat=22.75194" host=obscure-reaches-65656.herokuapp.com request_id=8d3b2cdc-d93b-4847-a04f-7539f08d884f fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=http
2018-03-18T06:40:43.751326+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/drivers?city=Taitung&lng=121.148208&lat=22.75194" host=obscure-reaches-65656.herokuapp.com request_id=3b5cf5a7-de08-4abb-ad0b-4c1969029bdd fwd="61.228.180.216" dyno= connect= service= status=503 bytes= protocol=http
我只是将我的项目部署到Heroku,确保API正常并连接我的服务器数据库。
我不知道我想念的是什么,无法弄清楚。
任何帮助将不胜感激。提前谢谢。