【问题标题】:clean exit - waiting for changes before restart?干净退出 - 重新启动前等待更改?
【发布时间】:2020-10-03 05:41:34
【问题描述】:

请告诉我如何解决这个问题,为什么它不启动并说重新启动

         const express = require('express');                                   
         const mongoose = require("mongoose");
         const app = express();
         const port = 3000;
                 app.post("/employee/add",(req,res)=>{
                     console.log("request is here");

                 })

        mongoose.connect("mongodb://localhost:27017//class-project")
            .then(()=>{
             app.listen(port),()=> {
             console.log('Server is listening on port ${port}');
             }
            })

【问题讨论】:

  • 看看我的回答是否对你有帮助,我会投票结束这个问题,因为它可能是由拼写错误引起的。
  • 另外,tt 建议您在问题中发布确切的错误消息,格式为代码(而不仅仅是“说重新启动”)

标签: node.js vue.js


【解决方案1】:
   mongoose.connect("mongodb://localhost:27017//class-project")
            .then(()=> {
              app.listen(port, ()=> console.log('Server is listening on port ${port}');
            })
   

【讨论】:

    猜你喜欢
    • 2018-08-06
    • 2018-07-10
    • 2021-09-07
    • 1970-01-01
    • 2011-09-12
    • 2017-06-13
    • 2020-11-07
    • 2021-05-15
    • 2019-02-17
    相关资源
    最近更新 更多