mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
feature(route) rm checkup
This commit is contained in:
parent
45590f2cc1
commit
784967800f
1 changed files with 10 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue