草庐IT

findPeopleByName

全部标签

javascript - 你如何在 Node.js 中调用 var 函数?

我有一个var函数可以检查数据库中的用户名,但我不知道如何在Node.js中调用它。这是我目前得到的://Getuser_namefrompost.app.post("/api/exercise/new-user",function(req,res){letuser_name=req.body.username;//GetstheURLfromthebodyofthepage.//CallfindPeopleByNamehere.});//Checkthedatabaseifuserexists.varfindPeopleByName=function(userName,done){U