Created
March 19, 2014 02:27
-
-
Save gansbrest/9634417 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var handleApiRequest = function(req, plugin, next) { | |
validate_path(req.path, function(err) { | |
if (err) { | |
var error = plugin.hapi.error.badRequest(err); | |
next(error); | |
} | |
}); | |
next(); | |
} | |
exports.register = function (plugin, options, next) { | |
// Api request parser and validator | |
plugin.ext('onPostAuth', function(req, extNext) { | |
reqHandlers.handleApiRequest(req, plugin, function(err) { | |
extNext(err); | |
}); | |
}); | |
next(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment