0.0.4 • Published 10 years ago

connect-browser v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
10 years ago

Connect-Browserify

This is a shim for connect for the browser.

Currently it doesn't implement any regex routes. So something like /my/:id wouldn't work, but normal routes work.

But how does it work on the client, theres no real server??

I'm using domnode-dom streams to pipe directly to document.body to achieve the same feel on client/server. That means you can do stuff like:

Example:

var connect = require('connect-browserify');
var app = connect()
app
  .use('/', function(req, res, next) {
    res.write('root');
    res.end();
  })
  .use('/hello', function(req, res, next) {
    res.write('hello');
    res.end();
  })
  .use('/world', function(req, res, next) {
    res.write('world');
    res.end();
  })
0.0.4

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago