优艾设计网

有什么好的开源nodejs服务器解决方案? 财富值78?

优艾设计网 https://www.uibq.com 2023-04-23 13:13 出处:网络 作者:磨皮美容教程
createServer();function createServer(){var http = nodeRequire(\"http\"); http.createServer(function(request, response) {let path = request.url; response.writeHead(200, {\"Content-Type\": \"text/html\

createServer();function createServer(){var http = nodeRequire("http"); http.createServer(function(request, response) {let path = request.url; response.writeHead(200, {"Content-Type": "text/html"}); let fs = nodeRequ优艾设计网_PS论坛ire("fs"); let data = fs.readFileSync(app_dir+path); response.write(data.toString()); response.end();}).listen(8888);}

就像这样,输出一个html文件,跟正常访问一样,不过遇到css、js什么都要自己判断。应该有现成的轮子可用了,推荐一个吧?


ty_一直很任性 优艾设计网_PS问答 2022-08-26 17:29

express


0

精彩评论

暂无评论...
验证码 换一张
取 消