Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,6 @@ Javalin.create()
.start();
```

### Usage with Helidon SE

The annotation processor will generate controller classes implementing the Helidon Service interface, which we can use
get all the Services and register them with Helidon `RoutingBuilder`.

```java
var routes = BeanScope.builder().build().list(Service.class);
var routingBuilder = Routing.builder().register(routes.stream().toArray(Service[]::new));
WebServer.builder()
.addMediaSupport(JacksonSupport.create())
.routing(routingBuilder)
.build()
.start();
```

### Usage with Helidon Nima

The annotation processor will generate controller classes implementing the Helidon HttpService interface, which we can use
Expand Down Expand Up @@ -162,36 +147,6 @@ public class WidgetController$Route implements WebRoutes {
}
```

### (Helidon SE) The generated WidgetController$Route.java is:
```java
@Generated("avaje-helidon-generator")
@Singleton
public class WidgetController$Route implements Service {

private final WidgetController controller;

public WidgetController$Route(WidgetController controller) {
this.controller = controller;
}

@Override
public void update(Routing.Rules rules) {

rules.get("/widgets/{id}", this::_getById);
rules.post("/widgets", this::_getAll);
}

private void _getById(ServerRequest req, ServerResponse res) {
int id = asInt(req.path().param("id"));
res.send(controller.getById(id));
}

private void _getAll(ServerRequest req, ServerResponse res) {
res.send(controller.getAll());
}
}
```

### (Helidon Nima) The generated WidgetController$Route.java is:

```java
Expand Down