-
Notifications
You must be signed in to change notification settings - Fork 0
Core
Marc Andre Herpers edited this page Oct 14, 2025
·
2 revisions
public class App extends FusionKit
{
public static void main( String[] args )
{
FusionKit.setApplication(App.class);
WebAppConfig webAppConfig = WebAppConfig.builder()
.name("TestWebApp")
.port(7000)
.domain("http://localhost")
.staticfiles(true)
.freemarker(true)
.debugger(true)
.productionLevel(ProductionLevel.PRODUCTION)
.build();
FusionKit.registerWebApplication(new WebApp(webAppConfig));
}
}
public class SwCodes extends WebApp {
public SwCodes(WebAppConfig config) {
super(config);
Javalin app = this.getApp();
app.get("/", new HomeHandler().toHandler());
}
}
public class HomeHandler extends FusionHandler {
@Override
public void handle(@NotNull FusionContext ctx) throws Exception {
ctx.attribute("data", "hello world");
ctx.render("home.html");
}
}