Sign In

clay-lambda

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clay-lambda - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+21
-21
index.js

@@ -1,36 +0,36 @@

let clayjs = function(routes) {
return function(event, done, fail) {
const method = event.raw.httpMethod
const path = event.raw.path
const apiPath = '/' + path.split('/').slice(3).join('/')
let routes = []
// Shortcuts
event.method = method;
event.path = path;
let clayjs = function (event, done, fail) {
const method = event.raw.httpMethod
const path = event.raw.path
const apiPath = '/' + path.split('/').slice(3).join('/')
if(routes.length == 0
// Shortcuts
event.method = method;
event.path = path;
if (routes.length == 0
|| routes == null) {
return fail('No routes are defiend')
}
return fail('No routes are defiend')
}
for(let i = 0; i < routes.length; i++) {
let route = routes[i]
for (let i = 0; i < routes.length; i++) {
let route = routes[i]
if(route.path == path
if (route.path == path
&& (route.method == method || route.method == '*')) {
return route.fn(event, done, fail)
}
return route.fn(event, done, fail)
}
}
return fail('Path ' + path + ' is not found.')
}
return fail('Path ' + path + ' is not found.')
}
function makeRequestMethod(type) {
return function(path, fn) {
return {
return function (path, fn) {
routes.push({
method: type,
fn,
path
}
})
}

@@ -37,0 +37,0 @@ }

{
"name": "clay-lambda",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",