Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.0

io.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