Serve Frontend with Actix
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 15s

This commit is contained in:
Mohamad 2025-01-03 10:43:38 +01:00
parent efd11a39b9
commit df4808bf38

View File

@ -1,4 +1,5 @@
use actix_cors::Cors;
use actix_files as fs;
use actix_web::{web, App, HttpServer};
use std::sync::{Arc, Mutex};
@ -23,6 +24,7 @@ async fn main() -> std::io::Result<()> {
.allow_any_method(),
)
.app_data(web::Data::new(db.clone()))
.service(fs::Files::new("/", "./frontend/dist").index_file("index.html"))
.route("/login", web::post().to(handlers::login)) // Public: Login
.route(
"/forms/{id}/submissions",