node 处理http
- 安装nodemon
它是个自动重启工具,当项目内的文件发生变化的时候它回自动重启服务,而不再需要我们再去手动启动服务。
npm install nodemon --save-dev
使用:
使用 nodemon app.js
代替 node app.js
其中app.js
就是项目的入口文件
2. 使用node 处理 http (GET、POST)
const http = require('http')
const querystring = require('querystring')
const server = http.createServer((req,res)