Package 

Class Javalin

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      JavalinConfig unsafeConfig()
      JettyServer jettyServer()
      static Javalin create() Creates a new instance without any custom configuration.
      static Javalin create(Consumer<JavalinConfig> config) Creates a new instance with the user provided configuration.
      static Javalin createAndStart(Consumer<JavalinConfig> config) Creates a new instance with the user provided configuration and starts it immediately.
      Servlet javalinServlet()
      Javalin start(String host, int port) Synchronously starts the application instance on the specified port with the given host IP to bind to.
      Javalin start(int port) Synchronously starts the application instance on the specified port.
      Javalin start() Synchronously starts the application instance on the configured port, or on the configured ServerConnectors if the Jetty server has been manually configured.
      Javalin stop() Synchronously stops the application instance.
      Javalin events(Consumer<EventConfig> listener)
      int port() Get which port instance is running on Mostly useful if you start the instance with port(0) (random port)
      <E extends Exception> Javalin exception(@NotNull() Class<E> exceptionClass, @NotNull() ExceptionHandler<out Object> exceptionHandler) Adds an exception mapper to the instance.
      Javalin error(int status, @NotNull() String contentType, @NotNull() Handler handler) Adds an error mapper for the specified content-type to the instance.
      Javalin addEndpoint(@NotNull() Endpoint endpoint) Adds a request handler for the specified handlerType and path to the instance.
      <E extends Exception> Javalin wsException(@NotNull() Class<E> exceptionClass, @NotNull() WsExceptionHandler<out Object> exceptionHandler) Adds a WebSocket exception mapper to the instance.
      Javalin addWsHandler(@NotNull() WsHandlerType handlerType, @NotNull() String path, @NotNull() Consumer<WsConfig> wsConfig, @NotNull() Array<RouteRole> roles) Adds a WebSocket handler of the specified type on the specified path.
      • Methods inherited from class io.javalin.router.JavalinDefaultRoutingApi

        addHttpHandler, after, afterMatched, before, beforeMatched, delete, error, get, head, options, patch, post, put, sse, ws, wsAfter, wsAfterUpgrade, wsBefore, wsBeforeUpgrade
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait