Move Port Number to Config.toml
This commit is contained in:
parent
2ac5931c79
commit
817f777059
1 changed files with 7 additions and 1 deletions
|
@ -40,6 +40,12 @@ macro_rules! api_base_3 {
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub(crate) struct ConfigToml {
|
pub(crate) struct ConfigToml {
|
||||||
auth: AuthenticationTokens,
|
auth: AuthenticationTokens,
|
||||||
|
port: PortConfig,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub(crate) struct PortConfig {
|
||||||
|
default: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
@ -270,7 +276,7 @@ async fn main() -> Result<()> {
|
||||||
.config(swagger_config.clone()),
|
.config(swagger_config.clone()),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.bind((Ipv6Addr::UNSPECIFIED, 8080)).expect("Port or IP already occupied")
|
.bind((Ipv6Addr::UNSPECIFIED, config.port.default)).expect("Port or IP already occupied")
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
let server_thread = tokio::spawn(async {
|
let server_thread = tokio::spawn(async {
|
||||||
|
|
Reference in a new issue