Brought web server into working order.
This commit is contained in:
+9
-1
@@ -25,6 +25,14 @@
|
||||
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
<groupId>org.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf</artifactId>
|
||||
<version>3.0.11.RELEASE</version>
|
||||
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -34,7 +42,7 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
<release>8</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user