Skip to content

Latest commit

History

History
78 lines (64 loc) · 2.91 KB

File metadata and controls

78 lines (64 loc) · 2.91 KB



JWS Web Framework

GitHub Workflow Status (branch)GitHubMaven metadata URLGitHub contributorsLines of codeDiscordTwitter Follow

Introduction

The Web Framework combines multiple JavaWebStack libraries with glue code and helpers to allow fast web development

Quick Example

classMyWebAppextendsWebApplication {
protectedvoidsetupConfig(Configconfig) {
config.addEnvFile(".env");
}
protectedvoidsetupModels(SQLsql) throwsORMConfigurationException {
}
protectedvoidsetupServer(HTTPServerserver) {
server.get("/", exchange -> {
return"Hello World";
});
server.controller(newExampleController());
}
}
// Example Controller@PathPrefix("/api/v1")
publicclassExampleControllerextendsHttpController {
@Get("/{name}")
publicGetSomethingResponsegetSomething(@Path("name") Stringname) {
GetSomethingResponseresponse = newGetSomethingResponse();
response.name = name;
// Automatically Serializes it to JSON if Accept header is not set.returnresponse;
}
@Post// If empty it uses the /api/v1 routepublicbooleancreateSomething(@BodyCreateSomethingRequestrequest) {
// @Body uses JSON for default to unserialize it into an object of the given type, but if the Accept header is set, you can use yaml or form System.out.println(request.name);
returntrue;
}
// Example Response ModelpublicclassGetSomethingResponse {
publicStringname;
}
// Example Request ModelpublicclassCreateSomethingRequest {
publicStringname;
}
}

Documentation

You can find the current docs on our website. This is a work-in-progress project though so it's not yet complete.

JWS Modules

  • Passport: A library for adding OAuth2 to authenticate in your Application

Community

JWS Modules

Projects built with JWS