0.0.5 • Published 8 years ago

mini-fileSystem-WebServer v0.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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_IGNORE

Of course, you can also use the ES5 compatiable mode via lib/build in this way whitout babel installed:

$ node index RELATIVE_PATH_OR_IGNORE

Use 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/b

Develop

cd mini-fileSystem-WebServer;
npm install;
npm run babel;

edit index.js and build to lib/index.js:

npm run build;

LICENSE

MIT License.

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago