Skip to content

Commit a942483

Browse files
committed
.
1 parent fc3a381 commit a942483

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

__tests__/basePath.unit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('Base Path Tests:', function() {
5555
it('should return testMiddleware: 123 when calling the root path', async function() {
5656
let _event = Object.assign({},event,{ path: '/v1' })
5757
let result = await new Promise(r => api.run(_event,{},(e,res) => { r(res) }))
58-
expect(result).toEqual({ multiValueHeaders: { 'content-type': ['application/json'] }, statusCode: 200, body: '{"method":"get","status":"ok"}', isBase64Encoded: false })
58+
expect(result).toEqual({ multiValueHeaders: { 'content-type': ['application/json'] }, statusCode: 200, body: '{"testMiddleware":"123"}', isBase64Encoded: false })
5959
})
6060

6161
it('Simple path with base: /v1/test', async function() {

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ class API {
140140
let route = this._prefix.concat(parsedPath);
141141

142142
// For root path support
143-
if (route.length === 0) {
143+
if (parsedPath.length === 0) {
144144
route.push('');
145145
}
146146

147147
// Keep track of path variables
148148
let pathVars = {};
149149

150150
// Make a local copy of routes
151-
let routes = this._routes;
151+
let routes = this._routes;
152152
// console.log('routes', JSON.stringify(routes));
153153

154154
// Create a local stack for inheritance

0 commit comments

Comments
 (0)