aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pom.xml77
-rw-r--r--src/main/java/com/pinapelz/Main.java5
-rw-r--r--src/main/java/com/pinapelz/frontend/App.kt9
3 files changed, 86 insertions, 5 deletions
diff --git a/pom.xml b/pom.xml
index 6860f34..b528cc9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,6 +12,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <kotlin.version>2.2.0</kotlin.version>
</properties>
<dependencies>
@@ -44,9 +45,14 @@
<version>42.7.7</version>
</dependency>
<dependency>
- <groupId>com.sparkjava</groupId>
- <artifactId>spark-core</artifactId>
- <version>2.9.4</version>
+ <groupId>io.javalin</groupId>
+ <artifactId>javalin</artifactId>
+ <version>6.7.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>2.0.16</version>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -54,12 +60,77 @@
<version>3.8.1</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-stdlib-jdk8</artifactId>
+ <version>${kotlin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-test</artifactId>
+ <version>${kotlin.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
<plugin>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-maven-plugin</artifactId>
+ <version>${kotlin.version}</version>
+ <executions>
+ <execution>
+ <id>compile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <sourceDirs>
+ <source>src/main/java</source>
+ <source>target/generated-sources/annotations</source>
+ </sourceDirs>
+ </configuration>
+ </execution>
+ <execution>
+ <id>test-compile</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>test-compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <jvmTarget>1.8</jvmTarget>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-compile</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>default-testCompile</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>compile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>testCompile</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
<configuration>
<source>15</source>
<target>15</target>
diff --git a/src/main/java/com/pinapelz/Main.java b/src/main/java/com/pinapelz/Main.java
index 22ead2c..9090160 100644
--- a/src/main/java/com/pinapelz/Main.java
+++ b/src/main/java/com/pinapelz/Main.java
@@ -3,7 +3,8 @@ package com.pinapelz;
import io.github.cdimascio.dotenv.Dotenv;
import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.requests.GatewayIntent;
-import static spark.Spark.*;
+
+import static com.pinapelz.frontend.AppKt.startFrontend;
public class Main
{
@@ -28,7 +29,7 @@ public class Main
public static void main(String[] args) throws Exception{
startBot();
- get("/hello", (req, res) -> "Hello World");
+ startFrontend();
}
diff --git a/src/main/java/com/pinapelz/frontend/App.kt b/src/main/java/com/pinapelz/frontend/App.kt
new file mode 100644
index 0000000..4a19793
--- /dev/null
+++ b/src/main/java/com/pinapelz/frontend/App.kt
@@ -0,0 +1,9 @@
+package com.pinapelz.frontend
+
+import io.javalin.Javalin
+
+fun startFrontend() {
+ val app = Javalin.create()
+ .get("/") { ctx -> ctx.result("WIP. Not much here yet") }
+ .start(7070)
+} \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage