0.0.5 • Published 11 years ago

connect-conductor v0.0.5

Weekly downloads
6
License
-
Repository
-
Last release
11 years ago

Conductor

Conductor is highly configurable routing middleware for Connect.

Build Status

Options

Some contrived examples:

{
  routes: {
    '/':                    '/path/to/route/to',      // static routing
    '/assets/css/*path':    '/dist/css/[path]',       // wildcard routes
    '/api/:version/*path':  '/api/v[version]/[path]', // named routes
    '/assets/js/*path':     '/dist/[site]/js/[path]', // routekey usage
    '/sites/:site/*path':   '/[site]/[path]'          // override the `site` routekey for this request
  }

  // can be overridden for individual requests
  routekeys: {
    'site': function (request) {
      return 'mysite';
    }
  }
}

Using With Grunt

// gruntfile definitions

connect: {
  options: {
    middleware: function (connect, options) {
      return [
        require('connect-conductor').route(options),
        // other middleware
      ]
    },

    routes: {
      // define routes
    },

    routekeys: {
      // define route keys
    }
  }
}
0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago