我用Node.js制作了一个应用,当我在Heroku上部署它时崩溃了。我重新启动heroku,它可以正常工作,直到再次崩溃。日志显示如下:
at=error code=H10 desc="App crashed" method=OPTIONS path="/api/auth" host=thawing-reaches-57928.herokuapp.com request_id=26eee27f-ea05-4643-9a14-91cf0163bd58 fwd="131.100.100.90" dyno= connect= service= status=503 bytes= protocol=https
我在index.js文件中的快递服务器是这个
const express = require("express");
const conectarDB = require("./config/db");
const cors = require("cors");
const app = express();
// DB conection
conectarDB();
app.use(cors());
app.use(express.json({ extended: true }));
const port = process.env.PORT || 4000;
app.use("/api/usuarios", require("./routes/usuarios"));
app.use("/api/auth", require("./routes/auth"));
app.use("/api/proyectos", require("./routes/proyectos"));
app.use("/api/tareas", require("./routes/tareas"));
app.listen(port, "0.0.0.0", () => {
console.log(`The server is running on the port: ${port}`)
});
有什么想法吗?