Created
January 24, 2022 14:21
-
-
Save erichonorez/35cd8a7735128a1fd9cc55b39b1d1b32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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