node -v :查看版本号
cd? D:\java\bin? :切换目标文件地址
node D:\java\bin :执行代码
tab 键快速补全路径
esc键快速清空当前已输入的命令
cls 清空终端
const express = require('express')
const app = express()
app.get('/home',(request,response)=>{
?? ?response.sendFile(_dirname + '/index.html')
})
app.listen(9000,()=>{...})
app.all('/cors-server',(request,response)=>{
?? ?//设置响应头
?? ?response.setHeader("Access-Control-Allow-Origin","*")
?? ?response.setHeader("Access-Control-Allow-Headers","*")
?? ?response.setHeader("Access-Control-Allow-Method","*")
?? ?response.send('...')
})