http://localhost:8000/ 无法访问
来源:5-2 处理get请求
HsiYuan
2022-04-25
代码
const http = require('http')
const querystring = require('querystring')
const server = http.createServer((req, res) => {
console.log('method:', req.method)
const url = req.url
console.log('url:', url)
req.query = querystring.parse(url, split('?')[1])
console.log('query:', req.query)
res.end(
JSON.stringify(req.query)
)
})
server.listen(8000)
console.log('Process Defined.')
问题截图
无输出
写回答
1回答
-
双越
2022-04-25
有 bug ,split 函数未定义
00
相似问题