Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sets a default statusCode of 200 for all API Gateway requests #1

Merged
merged 2 commits into from Aug 18, 2017

Conversation

mattbeattie
Copy link
Contributor

Problem

For all API Gateway requests, a statusCode is currently only sent if it's an error. This is because the only thing developers have access to when handling a route is the response body (which is stringified and placed on the response here).

Proposed Solution

Given that any error sets the statusCode accordingly, it should be safe to assume a default statusCode of 200.

This PR does the following

  • Sets a default value for the statusCode of 200 when handling API Gateway requests
  • Updates the corresponding unit tests to ensure that the response also includes the statusCode

@coveralls
Copy link

coveralls commented Aug 18, 2017

Coverage Status

Coverage increased (+0.04%) to 95.763% when pulling 37a9f96 on mattbeattie:sets-default-statuscode into cc7367d on doomhz:master.

@coveralls
Copy link

coveralls commented Aug 18, 2017

Coverage Status

Coverage increased (+0.04%) to 95.763% when pulling b01fa89 on mattbeattie:sets-default-statuscode into cc7367d on doomhz:master.

@doomhz doomhz merged commit e33c3e1 into doomhz:master Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants