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

refactor: should config support nested endpoints #57

Open
Regaez opened this issue Mar 6, 2020 · 0 comments
Open

refactor: should config support nested endpoints #57

Regaez opened this issue Mar 6, 2020 · 0 comments

Comments

@Regaez
Copy link
Owner

Regaez commented Mar 6, 2020

The current config setup doesn't easily allow for configuring nested endpoints. For example, if we have POST /api/pages/searches, currently there are only config exposed for the methods for /api/pages. But we don't want to use the POST config, because that gives permissions to allow a user to create a new resource, when a search action is actually reading existing pages data, so it's actually more suitable to be a GET request.

Using a GET config in the code for a POST request is potentially confusing. Perhaps it would be better to rename the endpoint config to be use case (read/create/update/delete) rather than method (get/post/patch/delete).

Or perhaps the config should support nested endpoints within an endpoint config, e.g.

endpoints:
  /pages:
    get: 
      enabled: true
      auth: false
    endpoints:
      /searches:
        post:
          enabled: false 
          auth: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant