inspired-server
Version:
A RESTful entity server
40 lines (31 loc) • 726 B
text/coffeescript
url = require 'url'
###
The REGEXP will match the following URLs:
/{name}
/{name}.{format}
/{name}/{id}
/{name}/{id}.{format}
/{name}/{id}/{rel}
/{name}/{id}/{rel}.{format}
The URL gets parsed into parts:
#1: name
#2: id OR `undefined`
#3: rel OR `undefined`
#4: format OR `undefined`
###
class Router
constructor: (@request) ->
return unless @isValid()
isIndex: ->
isValid: ->
'/favicon.ico'
]
module.exports = Router