Creating Levtus
Levtus have one single entry point: Levtus instance. In this section, you will learn how to create a new Levtus instance.
Creating a new Levtus Instance
Section titled “Creating a new Levtus Instance”You just need to create an entrance first:
Edit your Main.java to look like this:
import io.github.bernardusz.levtus.Levtus;
void main(){ Levtus app = Levtus.create();
app.get("/hello", ctx -> { ctx.text("Hello from Levtus Engine!"); });
app.listen(8080);}Run the application using the Gradle application plugin:
import io.github.bernardusz.levtus.Levtus;
public class Main { public static void main(String[] args) { Levtus app = Levtus.create();
app.get("/hello", ctx -> { ctx.text("Hello from Levtus Engine!"); });
app.listen(8080); }}You can set most of Levtus’ configuration via the app. But that is for later, feel free to explore, but for now, we’ll continue forward.