web-server-rewrite

Small HTTP server

npm install web-server-rewrite
6 downloads in the last week
11 downloads in the last month

Web Server ReWrite

A beautiful http server with php process and rewrite options (.htaccess)

Install

sudo npm install -g web-server-rewrite

How to start

To activate options rewriting, you must create a file called rewrite.json in your root project folder

The structure of rewrite.json is:

{
    "pages": {
        "/": "index.html",
        "/produtos": "produtos.html",
        "/produtos/:name/:id": "products.php?name=$1&id=$2",
        "/usuario/([a-z0-9.-_]+)": "user.php?user=$1"
    }
}

RegExp to RestFull style shortcuts:

:name, :page, :action, :module => ([\w]+)
:id => ([\d]+)

Usage: web-server [options]

Options:

  -p, --port     change port to server listen
  -b, --base     root folder for web access

Examples:

  $ web-server --port=3000
  $ web-server -b=public_html/
npm loves you