pub fn parse_arguments() -> Config {
    const CREATE_ADMIN: &'static str = "create_admin";
    const SECRET_KEY: &'static str = "secret_key";

    let matches = App::new("Weekend At Joes Backend")
        .version("0.1.0")
        .author("Henry Zimmerman")
        .about("Monolithic server for the API and frontend of the Weekend at Joes website.")
        .arg(
            Arg::with_name(CREATE_ADMIN)
                .long("create_admin")
                .help("Creates an administrator user if one doesn't already exist.")
                .takes_value(false),
        )
        .arg(
            Arg::with_name(SECRET_KEY)
                .long("secret")
                .short("s")
                .value_name("KEY")
                .help(
                    "A key string that is used to sign and verify user tokens. By specifying the same key across restarts, user tokens will not be invalidated. If no key is provided, then a random one is generated.",
                )
                .takes_value(true),
        )
        .get_matches();

    let create_admin: bool = matches.is_present(CREATE_ADMIN);
    let secret_key: Option<String> = matches.value_of(SECRET_KEY).map(String::from);
    let db_url: String = pool::DATABASE_URL.to_string();

    Config {
        create_admin,
        secret_key,
        db_url,
        enable_cors: false,
    }
}
/// Parses the arguments that the server may use when starting up.
Parses the arguments that the server may use when starting up.
Parses the arguments that the server may use when starting up .
pub fn parse_arguments() -> Config {
    const CREATE_ADMIN: &'static str = "create_admin";
    const SECRET_KEY: &'static str = "secret_key";
    let matches = App::new("Weekend At Joes Backend")
        .version("0.1.0")
        .author("Henry Zimmerman")
        .about("Monolithic server for the API and frontend of the Weekend at Joes website.")
        .arg(
            Arg::with_name(CREATE_ADMIN)
                .long("create_admin")
                .help("Creates an administrator user if one doesn't already exist.")
                .takes_value(false),
        )
        .arg(
            Arg::with_name(SECRET_KEY)
                .long("secret")
                .short("s")
                .value_name("KEY")
                .help(
                    "A key string that is used to sign and verify user tokens. By specifying the same key across restarts, user tokens will not be invalidated. If no key is provided, then a random one is generated.",
                )
                .takes_value(true),
        )
        .get_matches();
    let create_admin: bool = matches.is_present(CREATE_ADMIN);
    let secret_key: Option<String> = matches.value_of(SECRET_KEY).map(String::from);
    let db_url: String = pool::DATABASE_URL.to_string();
    Config {
        create_admin,
        secret_key,
        db_url,
        enable_cors: false,
    }
}
pub fn parse_arguments ( ) -> Config { const CREATE_ADMIN : & ' static str = " " ; const SECRET_KEY : & ' static str = " " ; let matches = App :: new ( " " ) . version ( " " ) . author ( " " ) . about ( " " ) . arg ( Arg :: with_name ( CREATE_ADMIN ) . long ( " " ) . help ( " " ) . takes_value ( false ) , ) . arg ( Arg :: with_name ( SECRET_KEY ) . long ( " " ) . short ( " " ) . value_name ( " " ) . help ( " " , ) . takes_value ( true ) , ) . get_matches ( ) ; let create_admin : bool = matches . is_present ( CREATE_ADMIN ) ; let secret_key : Option < String > = matches . value_of ( SECRET_KEY ) . map ( String :: from ) ; let db_url : String = pool :: DATABASE_URL . to_string ( ) ; Config { create_admin , secret_key , db_url , enable_cors : false , } }
Parses the arguments that the server may use when starting up.
Parses the arguments that the server may use when starting up .