public class LocalServerKt
| Modifier and Type | Method and Description |
|---|---|
static <T extends ComponentsProvider> |
runLocalServer(Api<T> api,
T components,
int port,
java.lang.String contextRoot,
java.lang.String staticFilesDir,
RequestContextFactory requestContextFactory)
Runs a very basic Jetty server running on the specified port that serves
class OsirisServlet from the root. |
public static <T extends ComponentsProvider> void runLocalServer(@NotNull Api<T> api, @NotNull T components, int port, @NotNull java.lang.String contextRoot, @Nullable java.lang.String staticFilesDir, @NotNull RequestContextFactory requestContextFactory)
Runs a very basic Jetty server running on the specified port that serves class OsirisServlet from the root.
This is a convenience method for running a local server from a main method. The implementation
runs and joins the server, so the method never returns and the server can only be stopped by killing
the process.
The contextRoot argument controls the URL on which the API is available. By default the API is
available at:
http://localhost:8080/
If contextRoot is /foo then the API would be available at:
http://localhost:8080/foo/
class OsirisServlet