The minimistic router from Spine, extracted microjs style.
- Use:
require('spine-route')
- Install:
npm install --save spine-route
- Use:
require('spine-route')
- Install:
npm install --save spine-route
- CDN URL:
//wzrd.in/bundle/spine-route@1.0.1
- Use:
require('spine-route')
- Install:
ender add spine-route
This is the Routing component of the Spine MVC framework extracted into its own module, microjs style.
For complete documentation, and usage, see the relevant spine documentation.
# Define our Application
class App
constructor: ->
# Import the router
Route = require('spine-route').Route
# Bind routes to our application methods
routes =
'/': 'routeApp'
'/site/:siteId/': 'routeApp'
'/site/:siteId/:fileCollectionId': 'routeApp'
'/site/:siteId/:fileCollectionId/*filePath': 'routeApp'
for own key,value of routes
Route.add(key, @[value].bind(@))
# Start the routing
Route.setup()
routeApp: (opts) ->
{siteId, fileCollectionId, filePath} = opts
# Create our application
app = new App()
Discover the change history by heading on over to the HISTORY.md
file.
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
These amazing people are maintaining this project:
- Benjamin Lupton b@lupton.cc (https://github.com/balupton)
No sponsors yet! Will you be the first?
These amazing people have contributed code to this project:
Licensed under the incredibly permissive MIT license
Copyright © 2013+ Bevry Pty Ltd us@bevry.me (http://bevry.me)
This work is based off prior work by Alex MacCaw and the Spine team, view their license here.