我对node很陌生,我试图为iOS notes应用程序创建一个简单的服务器,但当我在命令提示符下输入node server.js时,什么也没有发生。
”
//CREATE A NOTE
//Post request
app.post("/create", (req, res) => {
var Note = new Data({
note: req.get("note"),
title: req.get("title"),
date: req.get("data"),
})
note.save().then(() => {
if (note.isNew == false){
console.log("Save data!")
res.send("Saved data")
}else {
console.log("Failed to save data")
}
})
})
// http://10.11.210.1:8081/create
var server = app.listen(8081, "10.11.210.1", function(){
console.log("Server is running!")
})
1条答案
按热度按时间vof42yt11#