Nodejs / Express - Launching my app: express.createServer() is deprecated

前端 未结 5 1058
北荒
北荒 2020-12-05 02:55

I downloaded a node app to test and play around with. I have googled around and found that Express is found to be a little outdated. Can someone help me to fix the implement

5条回答
  •  有刺的猬
    2020-12-05 03:17

    I am already using the following snippet and it is working fine:

    var express =require("express");
    var http = require("http");
    
    var app = express();
    //app routers here 
    ...
    var httpServer = http.Server(app);
    
    httpServer.listen({PORT}, function(err){
    
    });
    

提交回复
热议问题