node-static
- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/cloudhead/node-static
软件介绍
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);