Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Mar 8, 2019
1 parent f32a7aa commit e131c96
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
An extremely __lightweight, flexible, and high performance__ [Undertow](http://undertow.io) based Java framework for developing RESTful web applications and microservices.

- __NO MAGIC__
- Lightweight: limited dependencies and < 340kb
- Incredibly easy to use and get started
- Limited dependencies and < 340kb
- JAX-RS compliant
- Easy on the developer and the metal
- Blazing fast!!!
Expand Down Expand Up @@ -157,7 +158,7 @@ If the response object's `contentType` is not explicitly set, the `@Produces` an
For methods that should return a `String` or `ByteBuffer` to the client users can create responses like this:
```java
...
import static io.sinistral.proteus.server.ServerResponse.response;
import static io.sinistral.proteus.server.ServerResponse.response;
...
@GET
@Path("/hello-world")
Expand All @@ -173,8 +174,9 @@ By default, passing a `String` to the static `ServerResponse.response` helper fu
For other types of responses the following demonstrates the preferred style:
```java
...
import static io.sinistral.proteus.server.ServerResponse.response;
...

import static io.sinistral.proteus.server.ServerResponse.response;
...
@GET
@Path("/world")
@Produces((MediaType.APPLICATION_JSON))
Expand All @@ -189,7 +191,8 @@ The entity can be set separately as well:
```java
...
import static io.sinistral.proteus.server.ServerResponse.response;

import static io.sinistral.proteus.server.ServerResponse.response;
...
@GET
@Path("/world")
Expand All @@ -204,8 +207,8 @@ public ServerResponse getWorld(Integer id, Integer randomNumber )
`CompletableFuture<ServerResponse<T>>` can also be used as a response type:

```java
...
import static io.sinistral.proteus.server.ServerResponse.response;
...
import static io.sinistral.proteus.server.ServerResponse.response;
...
@GET
@Path("/future/user")
Expand All @@ -220,7 +223,7 @@ In this case a handler will be generated with the following source code:

```java
...
import static io.sinistral.proteus.server.ServerResponse.response;
import static io.sinistral.proteus.server.ServerResponse.response;
...
public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws java.lang.Exception {
CompletableFuture<ServerResponse<User>> response = examplesController.futureUser();
Expand Down Expand Up @@ -537,4 +540,4 @@ Built With
- [Swagger](http://swagger.io/) (annotations and swagger spec)
- [JAX-RS](http://docs.oracle.com/javaee/6/api/javax/ws/rs/package-summary.html) (annotations only)



0 comments on commit e131c96

Please sign in to comment.