Brought web server into working order.

This commit is contained in:
barthiv73098
2019-11-19 17:07:08 +01:00
parent 274a3a32f2
commit 42426b3c3c
4 changed files with 40 additions and 9 deletions
+24 -1
View File
@@ -1,8 +1,31 @@
import io.javalin.Javalin;
import static io.javalin.plugin.rendering.template.TemplateUtil.model;
public class Quitt {
public static void main(String[] args) {
Javalin app = Javalin.create().start(7000);
app.get("/", ctx -> ctx.result("Hello World"));
app.config.addStaticFiles("/stylesheets");
app.config.addStaticFiles("/components");
app.get("/", ctx -> {
ctx.render("/index.html", model("firstName", "John", "lastName", "Doe"));
});
app.get("/index.html", ctx -> {
ctx.render("/index.html", model("firstName", "John", "lastName", "Doe"));
});
app.get("/balance.html", ctx -> {
ctx.render("/balance.html", model("firstName", "John", "lastName", "Doe"));
});
}
public void get()
{
}
}