Add Javalin framework to Discovery
This commit is contained in:
@@ -26,6 +26,12 @@
|
|||||||
<artifactId>log4j-core</artifactId>
|
<artifactId>log4j-core</artifactId>
|
||||||
<version>2.24.2</version>
|
<version>2.24.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.javalin</groupId>
|
||||||
|
<artifactId>javalin</artifactId>
|
||||||
|
<version>6.3.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package io.github.lumijiez;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import io.javalin.Javalin;
|
||||||
|
|
||||||
|
public class JavalinConfig {
|
||||||
|
public static Gson gson = new Gson();
|
||||||
|
|
||||||
|
public static void setup(Javalin app) {
|
||||||
|
app.get("/check", ctx -> ctx.result("OK"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
package io.github.lumijiez;
|
package io.github.lumijiez;
|
||||||
|
|
||||||
|
import io.javalin.Javalin;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
Javalin app = Javalin.create().start(8083);
|
||||||
|
JavalinConfig.setup(app);
|
||||||
|
|
||||||
|
|
||||||
System.out.print("Discovery service up and running");
|
System.out.print("Discovery service up and running");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package io.github.lumijiez.models.requests;
|
||||||
|
|
||||||
|
public class RegisterRequest {
|
||||||
|
public String hostname;
|
||||||
|
public String port;
|
||||||
|
|
||||||
|
public RegisterRequest(String hostname, String port) {
|
||||||
|
this.hostname = hostname;
|
||||||
|
this.port = port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHostname() {
|
||||||
|
return hostname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPort() {
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user