启动服务

  1. import { createServer } from 'http'
  2. const server = createServer()
  3. // 启动服务器:端口号 3000
  4. server.listen(3000, () => {
  5. console.log('http:\\localhost:3000')
  6. })