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

Make altda server api more RESTful #433

Open
samlaf opened this issue Oct 16, 2024 · 0 comments
Open

Make altda server api more RESTful #433

samlaf opened this issue Oct 16, 2024 · 0 comments

Comments

@samlaf
Copy link
Contributor

samlaf commented Oct 16, 2024

Is your feature request related to a problem? Please describe.

The altda server spec

image

has redundant (and confusing) path prefixes. Specifically, the /put/ and /get/ prefixes are redundant with the HTTP method, and in the case of /put/ is actually confusing because the POST method is used instead of PUT.

The Richardson Maturity Model https://martinfowler.com/articles/richardsonMaturityModel.html gives a theoretical framework for why having verbs in the route is bad practice (http verbs are for verbs, paths are supposed to be nouns). In practice, when implementing the routing for the da server, it means I need duplicate routes for /put/commitments and /get/commitment, whereas this should have the same route (just commitment) and router will allow both GET and POST methods against it.

Describe the solution you'd like

Would like to clean up the routes to look like

POST /<hex_encoded_commitment>
POST /
GET /<hex_encoded_commitment>

or perhaps to be more clear and self-documenting

POST /keccak/<hex_encoded_commitment>
POST /generic
GET /<hex_encoded_commitment>

Can make this change and keep the old routes if we want to maintain backward compatibility.

Describe alternatives you've considered

Additional context

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

1 participant