1 Star 0 Fork 0

run27017/命令行场景化小工具合集

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
echo-server 671 Bytes
一键复制 编辑 原始数据 按行查看 历史
run27017 提交于 2020-04-15 17:44 +08:00 . 添加若干命令
#!/usr/bin/env node
/* Usage: node server.js [port] */
const http = require('http')
const port = process.argv[2] || 3000
http.createServer(function (request, response) {
console.log('url', request.url)
console.log('method', request.method)
console.log('headers', request.headers)
let data = ''
request.on('data', function (chunk) {
data += chunk
})
request.on('end', function () {
console.log('----------body----------')
console.log(data)
response.end('request received.')
})
}).listen(port, err => {
if (err) {
console.log(`Something bad happened: ${err}.`)
} else {
console.log(`Server is listening on ${port}.`)
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/run27017/scenario_commands.git
git@gitee.com:run27017/scenario_commands.git
run27017
scenario_commands
命令行场景化小工具合集
master

搜索帮助