claudiajs / claudia

Deploy Node.js projects to AWS Lambda and API Gateway easily
https://claudiajs.com
MIT License
3.8k stars 274 forks source link

Can't get dynamic responses to work. #109

Closed lstone closed 7 years ago

lstone commented 7 years ago

Hi, I'm trying to integrate dynamic responses, but they always just return the ApiResponse in the body of the response.

The following handler response: return new api.ApiResponse('Abort', {'Content-Type': 'application/json'}, 404);

Always returns this as the body w/ a 200 status code. {"response":"Abort","headers":{"Content-Type":"application/json"},"code":404}

I would expect the response to set the status code, headers, and body. Any suggestions?

gojko commented 7 years ago

please put a full minimal project somewhere to demonstrate the problem, the error is likely in some other setup around this so it's difficult to say what is wrong just based on this snippet (this code looks correct)

gojko commented 7 years ago

closing this due to inactivity. if this is still an issue, please reopen the ticket