Last active
March 13, 2025 09:55
-
-
Save jmesnil/5f86e521068f6921f80ebb142c7f4704 to your computer and use it in GitHub Desktop.
Simple Web application with WildFly & JBang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///usr/bin/env jbang "$0" "$@" ; exit $? | |
| //DEPS com.github.lalyos:jfiglet:0.0.8 | |
| //DEPS org.wildfly.bom:wildfly-expansion:35.0.1.Final@pom | |
| //DEPS jakarta.ws.rs:jakarta.ws.rs-api | |
| //DEPS jakarta.enterprise:jakarta.enterprise.cdi-api | |
| //DEPS org.wildfly.glow:wildfly-glow:1.3.2.Final | |
| import jakarta.enterprise.context.ApplicationScoped; | |
| import jakarta.ws.rs.*; | |
| import jakarta.ws.rs.core.*; | |
| import com.github.lalyos.jfiglet.FigletFont; | |
| @ApplicationPath("/") | |
| public class myapp extends Application { | |
| @Path("/hello") | |
| @ApplicationScoped | |
| public static class Hello { | |
| @GET | |
| public String sayHello(@QueryParam("name") @DefaultValue("World") String name) throws Exception { | |
| String hello = String.format("Hello, %s!", name); | |
| return FigletFont.convertOneLine(hello); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment