setup ffsaf server
This commit is contained in:
29
src/main/java/fr/titionfire/SomePage.java
Normal file
29
src/main/java/fr/titionfire/SomePage.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package fr.titionfire;
|
||||
|
||||
import io.quarkus.qute.Template;
|
||||
import io.quarkus.qute.TemplateInstance;
|
||||
|
||||
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")
|
||||
public class SomePage {
|
||||
|
||||
private final Template page;
|
||||
|
||||
public SomePage(Template page) {
|
||||
this.page = requireNonNull(page, "page is required");
|
||||
}
|
||||
|
||||
@GET
|
||||
@Produces(MediaType.TEXT_HTML)
|
||||
public TemplateInstance get(@QueryParam("name") String name) {
|
||||
return page.data("name", name);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user