aqua
aqua copied to clipboard
Group feature
I think a group feature would be cool. It should maybe have some of the following features.
- Prefix
- Middleware
Maybe something like:
app.group((context) => {
context.get(...);
....
});
I really don't think if this is the style of code intended for this project, but I love decorators like they are used in Spring
Why not trying to create this as a side project :
@Controller("hello")
export default class students {
@get("/")
public static getStudent(req) {
return "hello world";
}
@get("/:name")
public static getStudent(req) {
return `hello, ${req.parameters.name} !`;
}
}
This looks very NestJS-ish, maybe it might go against the idea of being a minimal framework?
This looks very NestJS-ish, maybe it might go against the idea of being a minimal framework?
Exactly, that's why I talked about the idea of create such structure as a personal project instead of directly implementing this in aqua 😊
having decorators would definitely make the code much more readable from my personal opinion