[][src]Function rowdy::launch

pub fn launch<B: AuthenticatorConfiguration<Basic>>(
    config: Configuration<B>
) -> LaunchError

Convenience function to ignite and launch rowdy. This function will never return

Panics

Panics if during the Rocket igition, something goes wrong.

Example

extern crate rowdy;
extern crate serde_json;

use rowdy::Configuration;
use rowdy::auth::NoOpConfiguration;

// We are using the `NoOp` authenticator
let json = r#"{
    "token" : {
        "issuer": "https://www.acme.com",
        "allowed_origins": ["https://www.example.com", "https://www.foobar.com"],
        "audience": ["https://www.example.com", "https://www.foobar.com"],
        "signature_algorithm": "RS256",
        "secret": {
                    "rsa_private": "test/fixtures/rsa_private_key.der",
                    "rsa_public": "test/fixtures/rsa_public_key.der"
                   },
        "expiry_duration": 86400
       },
       "basic_authenticator": {}
}"#;
let config: Configuration<NoOpConfiguration> = serde_json::from_str(json).unwrap();

rowdy::launch(config);