Package ortus.boxlang.web
Class MiniServer
java.lang.Object
ortus.boxlang.web.MiniServer
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 - The host to listen on. Default is
BOXLANG_HOME/www
--debug - Enable debug mode or not. Default is false.
--host 0.0.0.0.
Examples:
java -jar boxlang-miniserver.jar --webroot /path/to/webroot --debug java -jar boxlang-miniserver.jar --port 80 --webroot /var/wwwThis will start the BoxLang MiniServer on port 8080, serving files from
/path/to/webroot, and enable debug mode.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic io.undertow.server.handlers.resource.ResourceManagerThe resource manager for the server.static booleanFlag to indicate if the server is shutting down.static WebsocketHandlerThe Websocket handler for the server. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.undertow.server.HttpServerExchangeGet the current HttpServerExchange for the thread.static WebsocketHandlerGet the WebsocketHandler for the server.static voidstatic voidsetCurrentExchange(io.undertow.server.HttpServerExchange exchange) Set the current HttpServerExchange for the thread.
-
Field Details
-
shuttingDown
public static boolean shuttingDownFlag to indicate if the server is shutting down. -
websocketHandler
The Websocket handler for the server. -
resourceManager
public static io.undertow.server.handlers.resource.ResourceManager resourceManagerThe resource manager for the server. Placed here for eacy access from predicates
-
-
Constructor Details
-
MiniServer
public MiniServer()
-
-
Method Details
-
main
-
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
Get the WebsocketHandler for the server.- Returns:
- The WebsocketHandler for the server.
-