Closed RdeWilde closed 8 years ago
This is more like a limitation in Dart. What I suggest you though, is to put your paths in a constant files where the nested paths are included in another constant.
This way you can have things like
const String api = '/api';
const String users = '$api/users';
@app.Group("$users")
class UsersGroup {
}
and so on.
My solution to this problem is to extend the Group annotation...
e.g.
class ApiGroup extends app.Group {
const ApiGroup(String urlPrefix) : super("/api" + urlPrefix);
}
@ApiGroup("/")
class IndexController extends Controller {}
And now I can just call the API specific annotation where I need it, and if needs be, extend that group to have sub groups.
I just got started with Dart and Redstone, looks great.
Is it possible to nest @app.Group thru some sort of structure?
I would ofcourse prefer splitting the services up into different parts (the UserService etc).
For example, possibly pseudo:
Would be awesome, thanks!