heroku [web.1]:进程退出,状态为0 heroku [web.1]:状态从开始更改为崩溃

时间:2018-12-10 00:41:27

标签: javascript node.js express heroku npm

我很确定我的代码正确

index.js

//...
const winston      = require('winston');
const express      = require('express');
const app          = express();


require('./startup/logging');
require('express-async-errors');
require('./startup/routes')(app);
require('./startup/db').connect();
require('./startup/config')();
require('./startup/validation')();
require('./startup/prod')(app);

app.get('/', function(req, res, next){
    res.status(200).send('Welcome!');
});

//error handler

app.use(errorHandler);


const port   = process.env.PORT || 3000

const server = app.listen(port, () => winston.info(`listening on port ${port}`))

module.exports = server

和parkage.json

{
  //...
  "main": "index.js",
  "scripts": {
   //...
    "start": "node index.js"
  },
  "engines": {
    "node": "10.x",
    "npm": "6.x"
  },

  //....
}

我部署到Heroku并收到此错误...heroku[web.1]: Process exited with status 0 ...heroku[web.1]: State changed from starting to crashed

最初它在工作,但是突然停了下来,我遵循了我在网上找到的所有说明,但是没有任何工作可以有人帮助吗?

0 个答案:

没有答案