feature(route) rm checkup

This commit is contained in:
coderaiser 2015-03-21 07:12:47 -04:00
parent 45590f2cc1
commit 784967800f

View file

@ -17,7 +17,6 @@
minify = require('minify'),
format = require('format-io'),
check = require('checkup'),
config = require(DIR_SERVER + 'config'),
@ -94,7 +93,8 @@
lenthPath = TMPL_PATH.length,
isRead = lengthTmpl === lenthPath;
check(arguments, ['callback']);
if (typeof callback !== 'function')
throw(Error('callback should be function!'));
if (isRead) {
callback();
@ -128,7 +128,14 @@
function route(request, response, callback) {
var name, p, isAuth, isFS, path;
check(arguments, ['req', 'res', 'callback']);
if (!request)
throw(Error('request could not be empty!'));
if (!response)
throw(Error('response could not be empty!'));
if (typeof callback !== 'function')
throw(Error('callback should be function!'));
name = ponse.getPathName(request);
isAuth = RegExp('^(/auth|/auth/github)$').test(name);