@rahul_tripathi/galaxy
Advanced tools
Comparing version 1.0.1-beta to 1.0.2-beta
16
index.js
@@ -61,2 +61,4 @@ const GALAXY_VERSION = 'v1.0.1-beta' | ||
}) | ||
} else if (obj.type === 'Moon') { | ||
obj.str += '$' | ||
} | ||
@@ -80,8 +82,4 @@ obj.regex = new RegExp(obj.str) | ||
} | ||
const buildErr = (event, code) => { | ||
const buildErr = (code) => { | ||
let res = responses[code] | ||
res.headers = { | ||
...res.headers, | ||
...event.headers || {} | ||
} | ||
return new Promise((resolve) => { | ||
@@ -120,12 +118,12 @@ resolve(res) | ||
} | ||
return buildErr(event, '404') | ||
return buildErr('404') | ||
} else { | ||
return buildErr(event, '404') | ||
return buildErr('404') | ||
} | ||
} else { | ||
return buildErr(event, '404') | ||
return buildErr('404') | ||
} | ||
} catch (err) { | ||
return buildErr(event, '500') | ||
return buildErr('500') | ||
} | ||
} |
{ | ||
"name": "@rahul_tripathi/galaxy", | ||
"version": "1.0.1-beta", | ||
"version": "1.0.2-beta", | ||
"description": "tiny api routing library for aws lambda", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,7 +22,7 @@ let galaxy = require('../index') | ||
httpMethod: 'GET', | ||
path: '/api/helloB?abc=k' | ||
path: '/api/helloB' | ||
})) | ||
console.log(apiRouter.resolve({ | ||
httpMethod: 'GET', | ||
path: '/api/hello/abc/mnop?abc=k' | ||
path: '/api/hello/abc/mnopppppppppppp' | ||
})) | ||
@@ -29,0 +29,0 @@ console.log(apiRouter.resolve({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9742
253