Skip to content

Add support for named routes #20

Open
@x7airworker

Description

@x7airworker

Add a name parameter to routing annotations such as @Get etc.
This would allow us generate absolute or relative URLs by name and change URLs with less impact on other parts of an application. In addition this could also be used to pre-validate path parameters and create even safer applications.

Examples

@PathPrefix("/api/users")
public class UserController {
    @Get("/{String:name}", name="greetUser")
    public String greet(@Path("name") String name) {
        return "Hello " + name;
   }
}

// In other parts of the application
server.makeRoute("greetUser", "JanHolger"); -> /api/users/JanHolger

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions