Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Simple middleware layer for web applications, inspired by Connect and others. Work in Progress.

tag: 0.0.1

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 samples
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .npmignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
Octocat-spinner-32 test.js
README.md

SimpleWeb

Simple middleware layer for web applications, inspired by Connect and others. Work in Progress.

Installation

Via npm using (Node.js)[http://nodejs.org]:

npm install simpleweb

Usage

Reference in your program:

var simpleweb = require('simpleweb');

A simple web server:

var simpleweb = require('simpleweb'),
    http = require('http');

var app = simpleweb();

// Configuring middleware

app.use(simpleweb.query());
app.use(simpleweb.body());
app.use(app.router);
app.use(simpleweb.static(path.join(__dirname, 'public')));

// Configuring routes

app.get('/', function (req, res) { /* .... */ });
app.get('/customer', function (req, res) { /* .... */ });
app.get('/customer/new', function (req, res) { /* .... */ });
app.post('/customer/new', function (req, res) { /* .... */ });
app.get('/supplier', function (req, res) { /* .... */ });

// Launch the web server

var server = http.createServer(app).listen(8000);

TBD

Development

git clone git://github.com/ajlopez/SimpleWeb.git
cd SimpleWeb
npm install
npm test

Samples

Static Simple site with static pages.

Customers Dinamic pages, in-memory repository.

Contribution

Feel free to file issues and submit pull requests — contributions are welcome.

If you submit a pull request, please be sure to add or update corresponding test cases, and ensure that npm test continues to pass.

Something went wrong with that request. Please try again.