1 Star 2 Fork 0

马树/jsbi-calculator

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_server.js 622 Bytes
一键复制 编辑 原始数据 按行查看 历史
Leslie Wong 提交于 2021-11-11 00:34 +08:00 . :cop:test: polish the test process
const http = require("http");
const url = require("url");
const fs = require("fs");
const server = http.createServer(function (request, response) {
const path = url.parse(request.url).pathname;
console.log(__dirname, path);
fs.readFile(__dirname + path, function (error, data) {
if (error) {
response.writeHead(404);
response.write("This page does not exist");
response.end();
} else {
response.writeHead(200, {
"Content-Type": "text/html",
});
response.write(data);
response.end();
}
});
});
server.listen(8082);
console.log("Server 8082 launched.");
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/leslie_wong/jsbi-calculator.git
git@gitee.com:leslie_wong/jsbi-calculator.git
leslie_wong
jsbi-calculator
jsbi-calculator
main

搜索帮助