Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (27 sloc) 1.51 KB
<?xml version="1.0" encoding="utf-8"?>
<!-- web server configuration file: this node can be child node, thus embedded in shared xml -->
<!--which HTTP ip and port this server listens to. -->
<!-- @param host, port: which ip port to listen to. if * it means all. -->
<server host="*" port="8099" host_state_name="">
<defaultHost rules_id="simple_rule"></defaultHost>
<!-- force "" to match to iternal npl_code_wiki site for debugging -->
<host name="" rules_id="npl_code_wiki" allow='{""}'></host>
<!--rules used when starting a web server. Multiple rules with different id can be defined. -->
<rules id="simple_rule">
<!--URI remapping example-->
<rule match='{"^[^%.]+$", "robots.txt"}' with="WebServer.redirecthandler" params='{"/"}'></rule>
<!--npl script example-->
<!--<rule match="%.lua$" with="WebServer.makeGenericHandler" params='{docroot="script/apps/WebServer/test", params={}, extra_vars=nil}'></rule>-->
<rule match='{"%.lua$", "%.npl$"}' with="WebServer.npl_script_handler" params='%CD%'></rule>
<!--npl server page example-->
<rule match="$" with="WebServer.npl_page_handler" params='%CD%'></rule>
<!--filehandler example, base dir is where the root file directory is. %CD% means current file's directory-->
<rule match="." with="WebServer.filehandler" params='{baseDir = "%CD%"}'></rule>