node-fileproxy
A simple HTTP proxy for serving static files
Installation
$ [sudo] npm install fileproxy
Usage
Using http
fileproxy.server()
var http = ;var fileproxy = ;var host = 'https://raw.githubusercontent.com';var server = http;server;
Using Expressjs
fileproxy.serverExpress
var http = ;var fileproxy = ;var app = ;var host = 'https://raw.githubusercontent.com';app;app;
Callback is optional. It will return http response status and mime type for result, and http response status for error.
Open http://localhost:8000/MidEndProject/node-fileproxy/master/README.md
in your browser. You will see a README file that gets from https://raw.githubusercontent.com/indexzero/node-portfinder/master/README.md
.
Note that node fileproxy
will return file with mime type based on its file extension, so use it only for proxying a static file.
To Do
- Koa
Maintainer
License
MIT