Macro ssg::macro_serve
source · macro_rules! macro_serve { ($server_address:expr, $document_root:expr) => { ... }; }
Expand description
macro_serve Macro
Start a server at the specified address with the given document root.
Arguments
$server_address- The address at which the server should listen, specified as an expression (expr).$document_root- The root directory of the documents that the server should serve, specified as an expression (expr).
Behaviour
The macro_serve macro starts a server at the specified address with the given document root. It internally calls the start function from an unspecified library, passing the server address and document root as arguments.
If the server starts successfully, the macro returns Ok(()). If an error occurs during server startup, the macro will panic with the error message provided by the unwrap method.