potree-auth 0.1.0

Authentication and project management for `potree` point clouds.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use axum::extract::Path;

use super::super::application::service::PotreeAssetService;
use super::router::AssetPathParams;
use crate::common::domain::StaticAsset;
use crate::common::utils::http::api_error::ApiError;

/// Serves a built, static `potree` asset,
pub(crate) async fn potree_asset(
    Path(AssetPathParams { path }): Path<AssetPathParams>,
    potree_assets: PotreeAssetService,
) -> Result<StaticAsset, ApiError> {
    Ok(potree_assets.request_asset(&path).await?)
}