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

Allow declaring a common root for routes. #196

Open
Jezza opened this issue Aug 20, 2019 · 1 comment
Open

Allow declaring a common root for routes. #196

Jezza opened this issue Aug 20, 2019 · 1 comment

Comments

@Jezza
Copy link

Jezza commented Aug 20, 2019

It would be cool if we could, when declaring routes, specify a context for a given set of routes.

It's not annoying per se, but it would be nice to see some structure.

On.context("/context", () -> {
    On.get("/thing1").json(...);
    On.get("/thing2").json(...);
})
@Jezza
Copy link
Author

Jezza commented Aug 20, 2019

I just realise it could be given the setup to setup the routes.

On.context("/context", setup -> {
    setup.get("/thing1").json(...);
    setup.get("/thing2").json(...);
});

EDIT: But then I just realised the setup is fairly static, so we can't just alter that...

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