A module of the amaya framework that implements routing of http paths and processing of path and query parameters.
To install it, you will need:
- Java 11+
- Maven/Gradle
- Amaya Core or set of core modules
- Fast route processing
- Static routing
- Dynamic routing
- Path parameter parsing
- Query parameter parsing
dependencies {
implementation group: 'com.github.romanqed', name: 'amaya-core', version: '2.0.0'
implementation group: 'com.github.romanqed', name: 'amaya-routing', version: '1.0.1'
}
<dependency>
<groupId>io.github.amayaframework</groupId>
<artifactId>amaya-core</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>io.github.amayaframework</groupId>
<artifactId>amaya-routing</artifactId>
<version>1.0.1</version>
</dependency>
import io.github.amayaframework.core.WebBuilders;
import io.github.amayaframework.http.HttpMethod;
public final class Main {
public static void main(String[] args) throws Throwable {
var cfg = RoutingConfigurers.create();
// Configure routes
var paths = cfg.getPathSet();
paths.set(HttpMethod.GET, "/hello", ctx -> {
ctx.getResponse().getWriter().write("Hello from amaya");
});
// Configure app
var builder = WebBuilders.create();
var app = builder
.setServerFactory(/* your web server factory here */)
.configureApplication(cfg)
.build();
app.bind(8080);
app.run();
}
}
- Gradle - Dependency management
- jfunc - Basic functional interfaces
- jsm - Finite state machine jit compiler
- amaya-core - Various amaya modules
- Black magic
- RomanQed - Main work
See also the list of contributors who participated in this project.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details