java-endpoint / DemoApplication.java
KevanSoon
changed dockerfile
a1f4435
raw
history blame
380 Bytes
public class DemoApplication {
public static void main(String[] args) {
// Hugging Face provides the port via environment variable
int port = Integer.parseInt(System.getenv().getOrDefault("PORT", "8080"));
Javalin app = Javalin.create().start(port);
app.get("/user", ctx -> {
ctx.json(new User("Kevan", 21));
});
}
}