1.0.10 • Published 7 years ago

response-static v1.0.10

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

使用方式

npm install response-static
var responseRes = require('response-static');
var http = require('http');
var path = require('path');
var cwd = process.cwd();

var server = http.createServer(function(req,res){

  // 静态资源的位置
  var filePath = path.join(cwd,'dist',req.url);

  // 响应请求
  responseRes(filePath,res);

});

server.listen(9002,()=>{
  console.log('静态资源监听');
});
1.0.10

7 years ago

1.0.9

7 years ago

1.0.6

7 years ago

1.0.0

7 years ago