Skip to content

Instantly share code, notes, and snippets.

@erichonorez
Created January 24, 2022 14:21
Show Gist options
  • Save erichonorez/35cd8a7735128a1fd9cc55b39b1d1b32 to your computer and use it in GitHub Desktop.
Save erichonorez/35cd8a7735128a1fd9cc55b39b1d1b32 to your computer and use it in GitHub Desktop.
class Scratchpad {
static enum RouteNames {
USERS_FORM,
USERS_JSON,
USER_GET,
USER_POST
};
public static void main(String[] args) {
new Routes(
Path(
"/users",
Get(Accept("application/json"),
RouteNames.USERS_JSON,
Post(ContentType("application/x-form-encoded"),
RouteNames.USERS_FORM,
Path(
"/{id}",
Get(RouteNames.USER_GET),
Post(RouteNames.USER_POST)))));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment