我正在尝试将一个json服务器数据库部署到heroku,但出现address not available
错误。
我将此命令用作网络测功机:json-server -p $PORT --watch ./data/grades.json -H filex-grades.herokuapp.com
json-server
确实开始,但是随后却给我一个EADDRNOTAVAIL
错误。这是日志:
2019-05-10T18:09:34.147439+00:00 app[web.1]: \{^_^}/ hi!
2019-05-10T18:09:34.147746+00:00 app[web.1]:
2019-05-10T18:09:34.147982+00:00 app[web.1]: Loading ./data/grades.json
2019-05-10T18:09:34.169691+00:00 app[web.1]: Done
2019-05-10T18:09:34.188714+00:00 app[web.1]:
2019-05-10T18:09:34.188850+00:00 app[web.1]: Resources
2019-05-10T18:09:34.188925+00:00 app[web.1]: http://filex-grades.herokuapp.com:33895/grades
2019-05-10T18:09:34.188994+00:00 app[web.1]: http://filex-grades.herokuapp.com:33895/external
2019-05-10T18:09:34.189055+00:00 app[web.1]:
2019-05-10T18:09:34.189146+00:00 app[web.1]: Home
2019-05-10T18:09:34.189213+00:00 app[web.1]: http://filex-grades.herokuapp.com:33895
2019-05-10T18:09:34.189272+00:00 app[web.1]:
2019-05-10T18:09:34.189710+00:00 app[web.1]: Type s + enter at any time to create a snapshot of the database
2019-05-10T18:09:34.191688+00:00 app[web.1]: Watching...
2019-05-10T18:09:34.191757+00:00 app[web.1]:
2019-05-10T18:09:34.228660+00:00 app[web.1]: Some error occurred { Error: listen EADDRNOTAVAIL: address not available 52.5.226.222:33895
2019-05-10T18:09:34.228663+00:00 app[web.1]: at Server.setupListenHandle [as _listen2] (net.js:1253:19)
2019-05-10T18:09:34.228665+00:00 app[web.1]: at listenInCluster (net.js:1318:12)
2019-05-10T18:09:34.228667+00:00 app[web.1]: at GetAddrInfoReqWrap.doListen [as callback] (net.js:1451:7)
2019-05-10T18:09:34.228668+00:00 app[web.1]: at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:61:10)
2019-05-10T18:09:34.228670+00:00 app[web.1]: code: 'EADDRNOTAVAIL',
2019-05-10T18:09:34.228672+00:00 app[web.1]: errno: 'EADDRNOTAVAIL',
2019-05-10T18:09:34.228673+00:00 app[web.1]: syscall: 'listen',
2019-05-10T18:09:34.228675+00:00 app[web.1]: address: '52.5.226.222',
2019-05-10T18:09:34.228677+00:00 app[web.1]: port: 33895 }
我当时在想,这可能与Heroku从http
重定向到https