Created
December 23, 2022 21:35
-
-
Save maxandersen/eab8d454ed1583888c81a1820a1394b1 to your computer and use it in GitHub Desktop.
This file contains 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
//DEPS io.micronaut:micronaut-http-server-netty:3.5.2 | |
//DEPS org.slf4j:slf4j-simple:1.6.1 | |
//DEPS io.micronaut:micronaut-http-client:3.5.2 | |
//DEPS io.micronaut:micronaut-inject-java:3.5.2 | |
//SOURCES MicroController.java | |
//JAVA 17+ | |
package jbang.test; | |
import io.micronaut.runtime.Micronaut; | |
public class Main { | |
public static void main(String[] args) { | |
Micronaut.run(args); | |
} | |
} |
This file contains 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
package jbang.test; | |
import io.micronaut.http.annotation.Controller; | |
import io.micronaut.http.annotation.Get; | |
@Controller("/hello") | |
public class MicroController { | |
static record Person(String firstName, String lastName, int age) { | |
} | |
@Get | |
public Person getPerson() { | |
return new Person("Firsty", "Lastly", 30); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment