mirror of
https://github.com/actix/examples
synced 2025-06-27 09:29:02 +02:00
standardize examples
This commit is contained in:
@ -13,10 +13,7 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Error> {
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> io::Result<()> {
|
||||
std::env::set_var("RUST_LOG", "actix_web=debug");
|
||||
env_logger::init();
|
||||
|
||||
println!("Started http server: https://127.0.0.1:8443");
|
||||
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
||||
|
||||
// load TLS keys
|
||||
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
|
||||
@ -25,6 +22,8 @@ async fn main() -> io::Result<()> {
|
||||
.unwrap();
|
||||
builder.set_certificate_chain_file("cert.pem").unwrap();
|
||||
|
||||
log::info!("starting HTTPS server at http://localhost:8443");
|
||||
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
// enable logger
|
||||
|
Reference in New Issue
Block a user