feat(client): refreshing the page no longer returns a 404

This commit is contained in:
perf3ct 2025-06-13 19:22:57 +00:00
parent e3f1855711
commit e672613d50
3 changed files with 6 additions and 4 deletions

View File

@ -6,7 +6,7 @@ use axum::{
};
use sqlx::Row;
use std::sync::Arc;
use tower_http::{cors::CorsLayer, services::ServeDir};
use tower_http::{cors::CorsLayer, services::{ServeDir, ServeFile}};
use tracing::{info, error};
mod auth;
@ -146,7 +146,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.nest("/api/users", routes::users::router())
.nest("/api/webdav", routes::webdav::router())
.merge(swagger::create_swagger_router())
.nest_service("/", ServeDir::new("/app/frontend"))
.nest_service("/", ServeDir::new("/app/frontend").fallback(ServeFile::new("/app/frontend/index.html")))
.fallback(serve_spa)
.layer(CorsLayer::permissive())
.with_state(Arc::new(state));

View File

@ -297,7 +297,9 @@ async fn process_file(
let saved_file_path = file_service.save_file(&filename, &file_data).await?;
let system_user_id = uuid::Uuid::parse_str("00000000-0000-0000-0000-000000000000")?;
// TODO: Make this configurable or fetch from database
// Using admin user ID for watch folder documents
let system_user_id = uuid::Uuid::parse_str("c2e66705-e54b-4eff-91f5-760cb0a69b62")?;
let document = file_service.create_document(
&filename,

View File

@ -12,7 +12,7 @@ use tokio::time::sleep;
use readur::models::{DocumentResponse, CreateUser, LoginRequest, LoginResponse};
const BASE_URL: &str = "http://localhost:8080";
const BASE_URL: &str = "http://localhost:8000";
const TIMEOUT: Duration = Duration::from_secs(30);
/// Integration test client that handles authentication and common operations