Raw NodeJS 路由

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 路由)