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

Question about the status code in the rule #221

Closed
greenlaw110 opened this issue Jun 1, 2018 · 5 comments
Closed

Question about the status code in the rule #221

greenlaw110 opened this issue Jun 1, 2018 · 5 comments

Comments

@greenlaw110
Copy link
Contributor

In the rules section it says:

  • GET '/' return status code 200 with empty body
  • GET '/user/:id' return status code 200 with the id
  • POST '/user' return status code 200 with empty body

As per HTTP standard, empty body should have a 204 response, and POST success normally indicates a create success, thus it might be good to return 201 Created.

@tbrand
Copy link
Collaborator

tbrand commented Jun 1, 2018

Agree but it requires a lot of efforts to fix. lol

@waghanza
Copy link
Collaborator

waghanza commented Jun 1, 2018

@tbrand I can do it ... question is to write rules that cover all use cases (what about https://www.techempower.com/benchmarks/)

@OvermindDL1
Copy link
Collaborator

Rules are good, the more detailed the better.

Like not just saying things like GET and 204 with empty body or so, but even more detailed so that the implementations remain good comparisons, things like routing must be performed a certain way or validation must be done on x-and-x, etc...

@waghanza
Copy link
Collaborator

waghanza commented Jul 3, 2018

@tbrand @OvermindDL1 digging for any benchmarks, and how developers use it / implement it
it appears that on most case, there is only 1 endpoint.

What do you think about that ?

I think it COULD be helpful to decrease our rule set to only one endpoint implementation, for example, it could be a GET to /hello/:name to ensure routing and param parsing.

The advantage I see :

  • simpler to implement -> to increase community
  • can focus on standard -> HTTP header, SO_REUSEPORT ...
  • simplify benchmarker code
  • less time to run (or we can publish more ofter with cloud results)

@OvermindDL1
Copy link
Collaborator

OvermindDL1 commented Jul 5, 2018

I'd think multiple routes are fine as there tend to be many in any given application and they are generally only another line of code in most of them anyway. Plus keeping them separate allows you to benchmark the different parts and handling of a framework as well.

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

No branches or pull requests

4 participants