const http = require('http')
const server = http.createServer()
server.on('request', (req, res) => {
let reqUrl = req.url
if (reqUrl.startsWith('/')) {
res.end('hello, visitor!')
}
})
server.listen(5000)
const http = require('http')
const server = http.createServer()
server.on('request', (req, res) => {
let reqUrl = req.url
if (reqUrl.startsWith('/')) {
res.end('hello, visitor!')
}
})
server.listen(5000)
本文标题:Raw NodeJS 路由
本文链接:https://www.haomeiwen.com/subject/ttkmeftx.html
网友评论