Micronaut

From Chorke Wiki
Jump to navigation Jump to search

Server

import io.micronaut.http.annotation.*;

@Controller("/hello")
public class HelloController {
    @Get("/")
    public String index() {
        return "Hello World";
    }
}

Client

import io.micronaut.http.annotation.Get;
import io.micronaut.http.client.annotation.Client;
import io.reactivex.Single;

@Client("/hello")
public interface HelloClient {
    @Get("/")
    Single<String> hello();
}

References