feat: mePage
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
package fr.titionfire;
|
||||
|
||||
import io.quarkus.qute.Template;
|
||||
import io.quarkus.qute.TemplateInstance;
|
||||
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.QueryParam;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
@Path("/some-page")
|
||||
@Path("api/some-page")
|
||||
public class SomePage {
|
||||
|
||||
private final Template page;
|
||||
@@ -22,8 +20,11 @@ public class SomePage {
|
||||
|
||||
@GET
|
||||
@Produces(MediaType.TEXT_HTML)
|
||||
public TemplateInstance get(@QueryParam("name") String name) {
|
||||
return page.data("name", name);
|
||||
public Uni<String> get() {
|
||||
return Uni.createFrom()
|
||||
.completionStage(() -> page
|
||||
.data("name", "test")
|
||||
.renderAsync());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user