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

https://github.com/treasure-data/underwrap

A very thin wrapper of Undertow and Resteasy
https://github.com/treasure-data/underwrap

resteasy undertow

Last synced: 5 months ago
JSON representation

A very thin wrapper of Undertow and Resteasy

Awesome Lists containing this project

README

          

# Underwrap
[](https://travis-ci.org/treasure-data/underwrap)

A very thin wrapper of Undertow and Resteasy

## Usage

### Maven

#### pom.xml

```xml


com.treasuredata
underwrap
0.1.4

```

### Gradle

#### build.gradle

```groovy
dependencies {
compile 'com.treasuredata:underwrap:0.1.4'
}
```

## Example

```java
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class UnderwrapExample
{
public static void main(String[] args)
{
UnderwrapServer server = new UnderwrapServer(MyApplication.class);
Map contextMqp = new HashMap<>();
contextMqp.put(String.class, "This is UnderwrapExample");
server.start(contextMqp, null,
serverBuild -> {
serverBuild.addHttpListener(8080, "0.0.0.0");
}
);
}

public static class MyApplication
extends UnderwrapServer.UnderwrapApplication
{
@Override
protected void registerResources(Set> classes)
{
classes.add(Resources.class);
}
}

@Path("/")
public static class Resources
{
private final String comment;

public Resources(@Context String comment)
{
this.comment = comment;
}

@GET
@Path("/hello")
public String hello()
{
return "Hello! " + comment;
}
}
}
```