0.0.5 • Published 10 years ago
mini-fileSystem-WebServer v0.0.5
Kelvin - A mini file system web server
A mini file system web server, you can call him Kelvin.
- /index.js, require- babel-core
- /lib/build.js, transfer from- babel-core, compatiable with- node: ~v0.12.x
Install
Install from npm,
npm install mini-fileSystem-WebServer;
node node_modules/mini-fileSystem-WebServer/lib/index.js;
# or run with babel-node
babel-node node_modules/mini-fileSystem-WebServer/index.js;Install from github:
git clone https://github.com/barretlee/mini-fileSystem-WebServer.git;
cd mini-fileSystem-WebServer;
npm run node;
# or run with babel-node
npm run babel;Usage
Command Line Mode
with babel-node,
$ babel-node index RELATIVE_PATH_OR_IGNOREOf course, you can also use the ES5 compatiable mode via lib/build in this way whitout babel installed:
$ node index RELATIVE_PATH_OR_IGNOREUse in File
import {start} from './index';
start({
  port: 3300,
  base: '..',
  favicon: 'http://barretlee.com/favicon.ico'
});or, es5 compatiable mode:
var start = require('./lib/build');
start({
  port: 3300,
  base: '..',
  favicon: 'http://barretlee.com/favicon.ico'
});There are two params:
- base, the relative path, not required.
- favicon, you knewn it, default is my avatar, not required.
and logs printed:
$ babel-node index ..
Listen at: http://localhost:8800
Visit: /Users/barret/work/test
Visit: /Users/barret/work/test/bug.js
Visit: /Users/barret/work/test/co
Visit: /Users/barret/work/test/co/test
Visit: /Users/barret/work/test/co/del
Visit: /Users/barret/work/test/co/del/bDevelop
cd mini-fileSystem-WebServer;
npm install;
npm run babel;edit index.js and build to lib/index.js:
npm run build;LICENSE
MIT License.