[][src]Function parody::start_relative_to_file

pub fn start_relative_to_file(
    upstream_url: &str,
    file: &str
) -> Result<Parody, Error>

Starts a server listening at random port at localhost for a directory relative to the given file

Example

use std::path::Path;
let parody = parody::start_relative_to_file("https://example.com", file!()).unwrap();
println!("PARODY_IP={}", parody.ip());
println!("PARODY_PORT={}", parody.port());