Package ws.osiris.localserver
Class LocalServerKt
-
- All Implemented Interfaces:
public final class LocalServerKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends ComponentsProvider> UnitrunLocalServer(Api<T> api, T components, Integer port, String contextRoot, String staticFilesDir, RequestContextFactory requestContextFactory)Runs a very basic Jetty server running on the specified port that serves OsirisServlet from the root. -
-
Method Detail
-
runLocalServer
final static <T extends ComponentsProvider> Unit runLocalServer(Api<T> api, T components, Integer port, String contextRoot, String staticFilesDir, RequestContextFactory requestContextFactory)
Runs a very basic Jetty server running on the specified port that serves OsirisServlet from the root.
This is a convenience method for running a local server from a
mainmethod. The implementation runs and joins the server, so the method never returns and the server can only be stopped by killing the process.The
contextRootargument controls the URL on which the API is available. By default, the API is available at:http://localhost:8080/If
contextRootis/foothen the API would be available at:http://localhost:8080/foo/
-
-
-
-