Skip to content

AmayaFramework/amaya-tomcat

Repository files navigation

amaya-tomcat amaya-tomcat

The amaya-server implementation is based on Apache Tomcat.

Getting Started

To install it, you will need:

  • Java 11+
  • Maven/Gradle

Features

  • Full implementation of amaya-server
  • Convenient interfaces for http request handling
  • Full access to tomcat configuration
  • Ready-to-use default configuration

Installing

Gradle dependency

dependencies {
    implementation group: 'io.github.amayaframework', name: 'amaya-tomcat', version: '3.3.3-10.1.46'
    // For websocket support (optionally)
    implementation group: 'io.github.amayaframework', name: 'tomcat-embed-websocket', version: '10.1.46'
}

Maven dependency

<dependencies>
    <dependency>
        <groupId>io.github.amayaframework</groupId>
        <artifactId>amaya-tomcat</artifactId>
        <version>3.3.3-10.1.46</version>
    </dependency>
    
    <!-- For Websocket support (optionally) -->
    <dependency>
        <groupId>io.github.amayaframework</groupId>
        <artifactId>tomcat-embed-websocket</artifactId>
        <version>10.1.46</version>
    </dependency>

Examples

Hello world

import com.github.romanqed.juni.UniRunnable1;
import io.github.amayaframework.tomcat.TomcatServerFactory;

public final class Main {
    public static void main(String[] args) throws Throwable {
        var factory = new TomcatServerFactory();
        var server = factory.create();
        server.bind(8080);
        server.handler(UniRunnable1.of(ctx -> {
            ctx.response().writer().println("Hello from Amaya (Tomcat 10)");
        }));
        server.start();
    }
}

Built With

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details

About

The amaya-server implementation is based on Apache Tomcat.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages