lambda-router
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -6,2 +6,5 @@ 'use strict'; | ||
/** | ||
* A routing framework for AWS Lambda | ||
*/ | ||
class LambdaRouter { | ||
@@ -20,2 +23,7 @@ | ||
/** | ||
* LambdaRouter class | ||
* | ||
* @param {Object} options contains 'basedir', 'routes' | ||
*/ | ||
constructor(options) { | ||
@@ -41,4 +49,4 @@ this._routes = {}; | ||
* | ||
* @param name | ||
* @returns {*} | ||
* @param {string} name | ||
* @returns {Function|null} | ||
*/ | ||
@@ -52,4 +60,4 @@ getRoute(name) { | ||
* | ||
* @param name | ||
* @param option | ||
* @param {string} name | ||
* @param {Object} option contains 'module', 'action' | ||
*/ | ||
@@ -56,0 +64,0 @@ setRoute(name, option) { |
{ | ||
"name": "lambda-router", | ||
"version": "0.0.1", | ||
"description": "A routing flamework for AWS Lambda", | ||
"version": "0.1.0", | ||
"description": "A routing framework for AWS Lambda", | ||
"main": "index.js", | ||
@@ -9,3 +9,4 @@ "scripts": { | ||
"lint": "eslint . --ignore-path .gitignore", | ||
"cover": "istanbul cover _mocha" | ||
"cover": "istanbul cover _mocha && codecov", | ||
"docs": "documentation readme -s 'API Docs' -g lib/**/*.js" | ||
}, | ||
@@ -28,2 +29,4 @@ "repository": { | ||
"devDependencies": { | ||
"codecov": "^1.0.1", | ||
"documentation": "^4.0.0-beta4", | ||
"eslint": "^2.9.0", | ||
@@ -30,0 +33,0 @@ "eslint-config-node-style-guide": "^3.0.0", |
@@ -105,2 +105,15 @@ 'use strict'; | ||
it('setRoute by invalid handler', () => { | ||
try { | ||
router.setRoute('directRoute', { | ||
handler: 'not a function', | ||
}); | ||
} catch (e) { | ||
assert.ok(true); | ||
return ; | ||
} | ||
assert.fail('expects occurring Error but never thrown'); | ||
}); | ||
it('setRoute after changing baseDir', () => { | ||
@@ -107,0 +120,0 @@ router.baseDir = ''; |
Sorry, the diff of this file is not supported yet
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
12710
12
241
1
41
7