lenode
NodeJS based minimalistic web-server
Last updated 3 years ago by marlock .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install lenode 
SYNC missed versions from official npm registry.

LeNode is a lesser (minimalistic) NodeJS based Web-server

Features

- Easy setup

You can setup your server by creating .indexes files by JSON format in any directory like this:

{
    "index_own.js" : {
        "executable" : true,
        "charset" : "utf8"
    },
    "second_own_index.html" : {
        "charset" : "win1251"
    },
    "third_own_index.ext" : {}
}

You can execute any file with any extension as a JS file. Any directory will get its parent indexes if you don't overwrite them Next, your executable pages must be created wrapped in page() function like this

page(
    write, // function that writes contents directly to page without buffering
    GET, // GET object (PHP analogue)
    POST, // POST object (PHP analogue)
    REQUEST, // REQUEST object (PHP analogue)
    headers, // request headers
    IP, // remote client IP
    addHeaders, // function that adds headers to queue (if you're used write(), headers will be placed no more). For setting responce code, you may use addHeaders({code:200}) (200 is default). If you will set an existing header, it will be overwrited by new
    polymorph // a function, that ables you easily to create an overflowed functions. Usage:
    /*
        var func = polymorph(
            function(a,b,c){return '3 any args passed';},
            {i: String, a: Boolean},
            function(i,a){return 'Passed string and boolean';}
        );
    */
    ){
    return 'Hell O MFs';
}

- Lightweight

On Windows 10 machine it using ~8-9 MBs of memory

- Extensible

Any changes (excluding main server file) will be applied immediately, there are no need to restart the server

Current Tags

  • 2.0.0-b                                ...           latest (3 years ago)

3 Versions

  • 2.0.0-b                                ...           3 years ago
  • 1.2.0-c [deprecated]           ...           3 years ago
  • 1.0.0-f [deprecated]           ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 4
Last Day 0
Last Week 0
Last Month 0
Dependencies (9)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |