关于 nodemon
相关代码:
const http = require("http");
const server = http.createServer((req, res) => {
const url = req.url;
const path = url.split("?")[0];
const method = req.method;
// console.log("url is:", url);
// console.log("method is:", method);
if (path === "/api/list" && method === "GET") {
res.end("this is list");
}
if (path === "/api/create" && method === "POST") {
res.end("this is create");
}
res.end("404");
});
server.listen(3000);相关代码:
{
"name": "hello",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev":"nodemon index.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"nodemon": "^2.0.15"
}
}相关截图:

问题描述:
老师你好,我这边重新运行后,就会出现这个错误,请问这是怎么回事
21
收起
正在回答 回答被采纳积分+1
1回答

恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星