Node.js res.send is not a function

前端 未结 5 1009
暗喜
暗喜 2020-12-16 11:01

I\'m trying the following code but it\'s giving me an error, \"res.send is not a function\". Please help me.

Here\'s the code:

var http = require(\'         


        
5条回答
  •  抹茶落季
    2020-12-16 11:25

    you should use req argument first and res as the second argument this will work without any issue

    app.get('/', function(req, res) {
     res.send("Rendering file")
    }

提交回复
热议问题