serve_features_with_watching

Function serve_features_with_watching 

Source
pub async fn serve_features_with_watching(
    features: &[Feature],
    port: u16,
    watch_path: PathBuf,
    on_ready: Option<Box<dyn FnOnce() + Send>>,
) -> Result<()>
Expand description

Starts an HTTP server with file watching for a specific directory.

§Arguments

  • features - Initial Feature objects to serve as JSON
  • port - Port number to run the server on
  • watch_path - Path to watch for file changes
  • on_ready - Optional callback to be called when server is ready

§Returns

  • Result<()> - Ok if server starts successfully, Err otherwise