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: rest api endpoints #9

Merged
merged 5 commits into from
Jan 10, 2023
Merged

Conversation

mikosramek
Copy link
Owner

Endpoints were getting way too long and hard to read, especially when doing requests around steps.

IE, http://localhost:3000/api/v1/63bcd5b40fa7101840a82609/63bcd47e3c6419acae2d13df/steps/63bcd47e3c6419acae2d13ac/63bcd47e3c6419acae2d13ae because of how account, army, and step id were being passed as query params.

This is now http://localhost:3000/api/v1/rules/create

Account ids have been moved to mainly be a request header. Army and step ids have been moved to mainly be apart of the request body.

/api/v1/:accountId/armies /api/v1/armies
GET / GET /:accountId
POST /create POST /create
GET /:armyId [removed]
/api/v1/:accountId/:armyId/steps /api/v1/steps
GET / GET /:armyId
POST /create POST /create
POST /:stepId/new-rule [moved]
DELETE /:stepId/:ruleId [moved]
[n/a] /api/v1/rules
[n/a] POST /create
[n/a] DELETE /remove

@mikosramek mikosramek merged commit 93c8793 into main Jan 10, 2023
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.

1 participant