Micronaut: Difference between revisions
Jump to navigation
Jump to search
(Created page with "==References== {| | valign="top" | * [https://micronaut.io/ Micronaut] | valign="top" | |}") |
No edit summary |
||
Line 1: | Line 1: | ||
==Server== | |||
<source lang="java"> | |||
import io.micronaut.http.annotation.*; | |||
@Controller("/hello") | |||
public class HelloController { | |||
@Get("/") | |||
public String index() { | |||
return "Hello World"; | |||
} | |||
} | |||
</source> | |||
==Client== | |||
<source lang="java"> | |||
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(); | |||
} | |||
</source> | |||
==References== | ==References== | ||
{| | {| |
Revision as of 10:53, 26 August 2021
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();
}