Marine
A web framework built over sparkjava
Maven
<dependency>
<groupId>com.harium.marine</groupId>
<artifactId>core</artifactId>
<version>1.1.0</version>
</dependency>
Usage
Example using dotenv.
...
public class Main {
public static void main(String[] args) {
System.out.println("Starting Server");
String host = Env.get("HOST");
System.out.println(host);
Web.port(Integer.parseInt(Env.get("PORT")));
Web.host(host);
// Defining public resources
Web.staticFileLocation("/public");
// Register Web Modules
Web.register(HealthCare.class); // Using class
Web.register(() -> get("/hello", (req, res) -> "Hello World")); // Using instance
// Init Web Modules
Web.init();
}
}
Need more information?
See examples