Skip to main content

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>>,
    skip_changes: bool,
    ignore_paths: Vec<PathBuf>,
    include_skipped_dirs: bool,
) -> 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
  • skip_changes - Whether changes were skipped during feature computation
  • ignore_paths - Folders to ignore when features are recomputed
  • include_skipped_dirs - Whether to scan folders skipped by default when features are recomputed

§Returns

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