使用 nodeJs/Adonis 在 heroku 上部署:我收到 503 状态 - 服务不可用

Deploy on heroku with nodeJs/Adonis: I'm getting 503 Status - Service Unvailable

我正在尝试使用 heroku 进行部署,但是当我进入 URL/route 时,我得到:

Status: 503 Service Unvailable.

我的申请只有api;

我的 ProcFile:

release: ENV_SILENT=true node ace migration:run --force 网络:ENV_SILENT=true npm start

当我 运行 git push heroku master 我得到:

Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 291 bytes | 145.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Node.js app detected remote: remote: -----> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote:
NODE_ENV=production remote: NODE_MODULES_CACHE=true remote:
NODE_VERBOSE=false remote: remote: -----> Installing binaries remote: engines.node (package.json): 10.16.3 remote: engines.npm (package.json): unspecified (use default) remote: remote:
Resolving node version 10.16.3... remote: Downloading and installing node 10.16.3... remote: Using default npm version: 6.9.0 remote: remote: -----> Restoring cache remote: - node_modules remote: remote: -----> Installing dependencies remote: Installing node modules (package.json + package-lock) remote: added 137 packages from 91 contributors and audited 5288 packages in 10.225s remote: found 2 high severity vulnerabilities remote: run npm audit fix to fix them, or npm audit for details remote: remote: -----> Build remote:
remote: -----> Pruning devDependencies remote: removed 137 packages and audited 4976 packages in 5.253s remote: found 2 high severity vulnerabilities remote: run npm audit fix to fix them, or npm audit for details remote: remote: -----> Caching build remote: - node_modules remote: remote: -----> Build succeeded! remote: -----> Discovering process types remote: Procfile declares types -> release, web remote: remote: -----> Compressing... remote: Done: 26M remote: -----> Launching... remote: ! Release command declared: this new release will not be available until the command succeeds. remote:
Released v20 remote: https://xxx.herokuapp.com/ deployed to Heroku remote: remote: Verifying deploy... done. remote: Running release command... remote: remote: Nothing to migrate remote: Waiting for release.... done. To https://git.heroku.com/xxx.git
xxx..62bc4e0 master -> master

我尝试在 localhost 中工作的不同路由,但是当我在 heroku 中尝试时,我得到 503。

已于 https://forum.adonisjs.com/t/deploy-on-heroku-im-receiving-503-service-unvailable/5069

解决

答案:尝试将HOST更改为0.0.0.0(在您的Heroku环境变量中)