Skip to content
1        10        20        30        40        50        60        701use std::path::PathBuf;23use actix_web::{App, HttpServer, web};4use anyhow::Context;5use obsidian_sync::{config::Settings, webdav, webdav::AppState};67#[actix_web::main]8async fn main() -> anyhow::Result<()> {9    let settings = Settings::from_env()?;10    let storage_root = PathBuf::from("/storage");11    std::fs::create_dir_all(&storage_root).context("creating /storage")?;1213    let state = web::Data::new(AppState::new(settings, storage_root)?);14    HttpServer::new(move || {15        App::new()16            .wrap(webdav::cors_policy())17            .app_data(state.clone())18            .configure(webdav::configure)19    })20    .bind(("0.0.0.0", 80))?21    .run()22    .await?;2324    Ok(())25}