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 | |
| 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')
| -rw-r--r-- | src/config/Whirl.default.toml | 1 | ||||
| -rw-r--r-- | src/config/mod.rs | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/config/Whirl.default.toml b/src/config/Whirl.default.toml index be63635..ed6a874 100644 --- a/src/config/Whirl.default.toml +++ b/src/config/Whirl.default.toml @@ -3,6 +3,7 @@ worldsmaster_username = "WORLDSMASTER" # DO NOT CHANGE UNLESS YOU KNOW WHAT YOU log_level = 1 # Generally, you should only change this if you are experiencing issues ip = "0.0.0.0" # DO NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING prompt_ps1 = "[WORLDSMASTER@Whirlsplash ~]$" +api.port = 8080 [distributor] worldsmaster_greeting = "Welcome to Whirlsplash!" 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(), |