Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amayaframework/amaya-routing
A module of the amaya framework that implements routing of http paths and processing of path and query parameters.
https://github.com/amayaframework/amaya-routing
Last synced: about 1 month ago
JSON representation
A module of the amaya framework that implements routing of http paths and processing of path and query parameters.
- Host: GitHub
- URL: https://github.com/amayaframework/amaya-routing
- Owner: AmayaFramework
- License: apache-2.0
- Created: 2024-10-12T09:26:02.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T17:55:56.000Z (2 months ago)
- Last Synced: 2024-10-26T02:05:08.790Z (2 months ago)
- Language: Java
- Homepage:
- Size: 114 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# amaya-routing [![amaya-routing](https://img.shields.io/maven-central/v/io.github.amayaframework/amaya-routing?color=blue)](https://repo1.maven.org/maven2/io/github/amayaframework/amaya-routing)
A module of the amaya framework that implements routing of http paths
and processing of path and query parameters.## Getting Started
To install it, you will need:
* Java 11+
* Maven/Gradle
* Amaya Core or set of core modules### Features
* Fast route processing
* Static routing
* Dynamic routing
* Path parameter parsing
* Query parameter parsing## Installing
### Gradle dependency
```Groovy
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'
}
```### Maven dependency
```
io.github.amayaframework
amaya-core
2.0.0io.github.amayaframework
amaya-routing
1.0.1```
## Examples
### Hello world
```Java
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();
}
}```
## Built With
* [Gradle](https://gradle.org) - Dependency management
* [jfunc](https://github.com/RomanQed/jfunc) - Basic functional interfaces
* [jsm](https://github.com/RomanQed/jsm) - Finite state machine jit compiler
* [amaya-core](https://github.com/AmayaFramework/amaya-core) - Various amaya modules
* Black magic## Authors
* **[RomanQed](https://github.com/RomanQed)** - *Main work*
See also the list of [contributors](https://github.com/AmayaFramework/amaya-jetty/contributors)
who participated in this project.## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details