claudiajs / claudia-api-builder

Use AWS API Gateway as if it were a lightweight JavaScript web server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use root path as resource

christophercliff opened this issue · comments

When I set:

api.get('/', myThing)

Then run claudia update, I get an error:

{
     message: 'Resource\'s path part must be specified',
     code: 'BadRequestException',
     time: Mon Feb 22 2016 20:47:08 GMT-0600 (CST),
     requestId: 'bb2ad343-d9d7-11e5-bc97-275099d33c06',
     statusCode: 400,
     retryable: false,
     retryDelay: 71.45924023352563
 }

Is this deliberate in Claudia? It appears to be possible in the AWS console.

this doesn't work at the moment because we didn't think of it :) shouldn't be hard to add, I'll try to push it into the next release.

This should now be fixed by claudiajs/claudia@126d6e3 - if you update the claudia package to 1.0.4 (now on NPM), the root mapping should work. (although this issue is in the API Builder project, the actual mapping implementation is not here, but in the main claudia source)

Please try it and let me know if it does what you need.

That worked, thanks.