23 lines
567 B
Java
23 lines
567 B
Java
package org.lumijiez;
|
|
|
|
import org.lumijiez.core.http.HttpServer;
|
|
|
|
public class Main {
|
|
public static void main(String[] args) {
|
|
HttpServer httpServer = new HttpServer(8080);
|
|
|
|
httpServer.GET("/hello", (req, res) -> {
|
|
res.sendResponse(200, "Hello, World!");
|
|
});
|
|
|
|
httpServer.GET("/goodbye", (req, res) -> {
|
|
res.sendResponse(200, "Goodbye, World!");
|
|
});
|
|
|
|
httpServer.POST("/data", (req, res) -> {
|
|
res.sendResponse(200, "Data received");
|
|
});
|
|
|
|
httpServer.start();
|
|
}
|
|
} |