index.js
function accept(req, res, cb) {
	var u = url.parse(req.url, true),
		path = u.pathname

	if(/^\/api\/?$/.test(path)) {
		messageInit({cb:(cb || nop), req:req, res:res, path:path, query:u.query, u:u})
		return;
	}

	if(req.method == "OPTIONS") {
		res.writeHead(200, {
			"Access-Control-Allow-Origin": "*",	// to support cross-domain script execution of our api
			"Access-Control-Max-Age": "0",
		})
		res.end()
		return;
	}

	www(req, res)					// everything else handled by paperboy
}
function accept(req, res, cb) {
	var u = url.parse(req.url, true),
		path = u.pathname

	if(/^\/api\/?$/.test(path)) {
		messageInit({cb:(cb || nop), req:req, res:res, path:path, query:u.query, u:u})
		return;
	}

	if(req.method == "OPTIONS") {
		res.writeHead(200, {
			"Access-Control-Allow-Origin": "*",	// to support cross-domain script execution of our api
			"Access-Control-Max-Age": "0",
		})
		res.end()
		return;
	}

	www(req, res)					// everything else handled by paperboy
}
function accept ( req , res , cb ) { var u = url . parse ( req . url , true ) , path = u . pathname if ( / ^\/api\/?$ / . test ( path ) ) { messageInit ( { cb : ( cb || nop ) , req : req , res : res , path : path , query : u . query , u : u } ) return ; } if ( req . method == "OPTIONS" ) { res . writeHead ( 200 , { "Access-Control-Allow-Origin" : "*" , // to support cross-domain script execution of our api "Access-Control-Max-Age" : "0" , } ) res . end ( ) return ; } www ( req , res ) // everything else handled by paperboy }
Every request starts here
Every request starts here