node-static :兼容 RFC 2616 的 HTTP 靜態文件服務器Node.js模塊
node-static 是 Node.js 兼容 RFC 2616 的 HTTP 靜態文件服務器處理模塊,提供內置的緩存支持。
示例代碼:
var static = require('node-static'); // // Create a node-static server instance to serve the './public' folder // var file = new(static.Server)('./public'); require('http').createServer(function (request, response) { request.addListener('end', function () { // // Serve files! // file.serve(request, response); }); }).listen(8080);
本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!