fn stage() -> AdHoc {
    AdHoc::on_ignite("thorns", move |rocket| async {
        // Load configuration from CLI
        let args = cli::Cli::parse();
        let target_dir = args.target().to_path_buf();

        // Load the compiler visibility data
        let trace_path = get_trace_file(target_dir.clone());
        let trace = Trace::load(trace_path).unwrap();

        let sourcemap_path = get_sourcemap_file(target_dir.clone());
        let sourcemap = SourceMap::load(sourcemap_path).unwrap();

        // Check if there is an env override for the location of the Viewer React app
        let viewer_path = std::env::var(VIEWER_PATH_ENV).unwrap_or(DEFAULT_VIEWER_PATH.to_string());

        rocket
            .mount("/", rocket::fs::FileServer::from(&viewer_path))
            .mount("/data", routes![get_data, get_graph])
            .manage(trace)
            .manage(sourcemap)
            .attach(CORS)
    })
}
/// Configure the shared state of the trace data and source map
Configure the shared state of the trace data and source map
Configure the shared state of the trace data and source map
fn stage() -> AdHoc {
    AdHoc::on_ignite("thorns", move |rocket| async {
        // Load configuration from CLI
        let args = cli::Cli::parse();
        let target_dir = args.target().to_path_buf();
        // Load the compiler visibility data
        let trace_path = get_trace_file(target_dir.clone());
        let trace = Trace::load(trace_path).unwrap();
        let sourcemap_path = get_sourcemap_file(target_dir.clone());
        let sourcemap = SourceMap::load(sourcemap_path).unwrap();
        // Check if there is an env override for the location of the Viewer React app
        let viewer_path = std::env::var(VIEWER_PATH_ENV).unwrap_or(DEFAULT_VIEWER_PATH.to_string());
        rocket
            .mount("/", rocket::fs::FileServer::from(&viewer_path))
            .mount("/data", routes![get_data, get_graph])
            .manage(trace)
            .manage(sourcemap)
            .attach(CORS)
    })
}
fn stage ( ) -> AdHoc { AdHoc :: on_ignite ( " " , move | rocket | async { // Load configuration from CLI let args = cli :: Cli :: parse ( ) ; let target_dir = args . target ( ) . to_path_buf ( ) ; // Load the compiler visibility data let trace_path = get_trace_file ( target_dir . clone ( ) ) ; let trace = Trace :: load ( trace_path ) . unwrap ( ) ; let sourcemap_path = get_sourcemap_file ( target_dir . clone ( ) ) ; let sourcemap = SourceMap :: load ( sourcemap_path ) . unwrap ( ) ; // Check if there is an env override for the location of the Viewer React app let viewer_path = std :: env :: var ( VIEWER_PATH_ENV ) . unwrap_or ( DEFAULT_VIEWER_PATH . to_string ( ) ) ; rocket . mount ( " " , rocket :: fs :: FileServer :: from ( & viewer_path ) ) . mount ( " " , routes ! [ get_data get_graph ] ) . manage ( trace ) . manage ( sourcemap ) . attach ( CORS ) } ) }
Configure the shared state of the trace data and source map
Configure the shared state of the trace data and source map