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(main): Use nested routing #6

Merged
merged 2 commits into from
Oct 29, 2023
Merged

refactor(main): Use nested routing #6

merged 2 commits into from
Oct 29, 2023

Conversation

algernon
Copy link
Collaborator

Rather than repeating the route prefixes, use nested routing. This does require splitting out the Codeberg redirect from the rest of the Forgejo routes, but that's not necessarily a bad thing. (Implemented in be9eb85)

The topmost commit (42548aa) adds a /v1/gitea route, handled by the same code as /v1/forgejo, without a redirect.

Builds on top of #2.

Copy link
Owner

@cafkafk cafkafk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #2 merged, this should be based on main instead and the commits from #2 should be removed from this. When that's done, it will be easier for me to see the diff.

I think making the routes nested is a good idea, and I like how this simplifies the codebase.

Rather than repeating the route prefixes, use nested routing. This does
require splitting out the Codeberg redirect from the rest of the Forgejo
routes, but that's not necessarily a bad thing.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
Add a `/v1/gitea` route, handled by the same code as `/v1/forgejo`.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
@algernon
Copy link
Collaborator Author

Rebased on main & force pushed

Copy link
Owner

@cafkafk cafkafk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing here that needs fixing, thanks for the contribution ❤️

@cafkafk cafkafk merged commit 6eff6fe into cafkafk:main Oct 29, 2023
3 checks passed
@algernon algernon deleted the nesting-routes branch October 29, 2023 09:56
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

2 participants