feat: support tls

This commit is contained in:
sigoden
2022-06-02 11:06:41 +08:00
parent 97978719b3
commit e2d7f996c7
6 changed files with 307 additions and 108 deletions

View File

@@ -4,16 +4,11 @@ macro_rules! bail {
}
}
#[macro_use]
extern crate log;
mod args;
mod server;
pub type BoxResult<T> = Result<T, Box<dyn std::error::Error>>;
use log::LevelFilter;
use crate::args::{matches, Args};
use crate::server::serve;
@@ -24,14 +19,6 @@ async fn main() {
async fn run() -> BoxResult<()> {
let args = Args::parse(matches())?;
if std::env::var("RUST_LOG").is_ok() {
simple_logger::init()?;
} else {
simple_logger::SimpleLogger::default()
.with_level(LevelFilter::Info)
.init()?;
}
serve(args).await
}