Class MiniServer

java.lang.Object
ortus.boxlang.web.MiniServer

public class MiniServer extends Object
The BoxLang MiniServer is a simple web server that serves BoxLang files and static files. The following command line arguments are supported: --port - The port to listen on. Default is 8080. --webroot - The path to the webroot. Default is BOXLANG_HOME/www --debug - Enable debug mode or not. Default is false. --host - The host to listen on. Default is 0.0.0.0. Examples:
 java -jar boxlang-miniserver.jar --webroot /path/to/webroot --debug
 java -jar boxlang-miniserver.jar --port 80 --webroot /var/www
 
This will start the BoxLang MiniServer on port 8080, serving files from /path/to/webroot, and enable debug mode.
  • Field Details

    • shuttingDown

      public static boolean shuttingDown
      Flag to indicate if the server is shutting down.
    • websocketHandler

      public static WebsocketHandler websocketHandler
      The Websocket handler for the server.
    • resourceManager

      public static io.undertow.server.handlers.resource.ResourceManager resourceManager
      The resource manager for the server. Placed here for eacy access from predicates
  • Constructor Details

    • MiniServer

      public MiniServer()
  • Method Details

    • main

      public static void main(String[] args)
    • getCurrentExchange

      public static io.undertow.server.HttpServerExchange getCurrentExchange()
      Get the current HttpServerExchange for the thread.
      Returns:
      The current HttpServerExchange for the thread.
    • setCurrentExchange

      public static void setCurrentExchange(io.undertow.server.HttpServerExchange exchange)
      Set the current HttpServerExchange for the thread.
      Parameters:
      exchange -
    • getWebsocketHandler

      public static WebsocketHandler getWebsocketHandler()
      Get the WebsocketHandler for the server.
      Returns:
      The WebsocketHandler for the server.