sfr-server 0.1.2

The server implementation for a Slack App.
Documentation
//! A configuration for a server.

use std::net::SocketAddr;
use typed_builder::TypedBuilder;

/// The configuration for a server.
#[derive(Clone, Debug, TypedBuilder)]
pub struct Config {
    /// The listen address.
    #[builder(default = "127.0.0.1:3000".parse().unwrap())]
    pub sock: SocketAddr,

    /// The log level when set at server startup.
    #[builder(default = None)]
    pub log: Option<String>,

    /// The path to provide home page. The home page should presents the installation button.
    #[builder(default = "/".into())]
    pub home_path: String,

    /// The path to receive a slash command request.
    #[builder(default = "/slash-command".into())]
    pub slash_command_path: String,

    /// The path to receive a OAuth request.
    #[builder(default = "/oauth/v2/redirect".into())]
    pub oauth_path: String,

    /// The configuration to serve static files.
    #[builder(default = StaticPathConfig::builder().build())]
    pub static_path: StaticPathConfig,
}

/// The configuration to serve static files.
#[derive(Clone, Debug, TypedBuilder)]
pub struct StaticPathConfig {
    /// The HTTP path to serve static files.
    #[builder(default = "/remote".to_string())]
    pub http: String,

    /// The local directory path to serve static files.
    #[builder(default = "./assets/remote".to_string())]
    pub local: String,
}