diff options
| author | Fuwn <[email protected]> | 2021-05-10 15:50:51 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-10 15:55:30 -0700 |
| commit | c9e1bc37faf2e4d15bf9a9aa18a5f483d9235518 (patch) | |
| tree | 7cc25b93f1a46f3bd4da1b1ae650c217f9c403b7 /src/config/mod.rs | |
| parent | Merge pull request #16 from Whirlsplash/renovate/commitizen-4.x (diff) | |
| download | whirl-c9e1bc37faf2e4d15bf9a9aa18a5f483d9235518.tar.xz whirl-c9e1bc37faf2e4d15bf9a9aa18a5f483d9235518.zip | |
perf(api): use actix_web instead of rocket for api
Refactors API for Actix, also enables CORS.
BREAKING CHANGE: `whirlsplash.port.api` configuration key created.
closes #20
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index ef86810..6b50086 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -9,6 +9,11 @@ pub struct WhirlsplashConfig { pub log_level: i64, pub ip: String, pub prompt_ps1: String, + pub api: WhirlsplashApiConfig, +} +#[derive(Serialize, Deserialize, Debug)] +pub struct WhirlsplashApiConfig { + pub port: i64, } #[derive(Serialize, Deserialize, Debug)] pub struct DistributorConfig { @@ -54,6 +59,9 @@ impl Default for Config { log_level: 1, ip: "0.0.0.0".to_string(), prompt_ps1: "[WORLDSMASTER@Whirlsplash ~]$".to_string(), + api: WhirlsplashApiConfig { + port: 80 + }, }, distributor: DistributorConfig { worldsmaster_greeting: "Welcome to Whirlsplash!".to_string(), |