-
-
Save msgilligan/c18ebfa6395db858403bdaa77063d554 to your computer and use it in GitHub Desktop.
Micronaut JBang Example
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 $? | |
| //JAVA 21 | |
| //JAVAC_OPTS -proc:full | |
| //DEPS io.micronaut.platform:micronaut-platform:4.10.3@pom | |
| //DEPS io.micronaut:micronaut-http-server-netty | |
| //DEPS io.micronaut:micronaut-inject-java | |
| //DEPS io.micronaut:micronaut-jackson-databind | |
| //DEPS org.slf4j:slf4j-simple | |
| package app; | |
| import io.micronaut.http.annotation.*; | |
| import io.micronaut.http.MediaType; | |
| import io.micronaut.runtime.Micronaut; | |
| public class App { | |
| public static void main(String... args) { | |
| Micronaut.run(args); | |
| } | |
| } | |
| @Controller("/hello") | |
| class HelloController { | |
| @Get | |
| @Produces(MediaType.TEXT_PLAIN) | |
| String hello() { | |
| return "Hello world"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment