What is the proper way of serving web files (html+js+wasm) using Actix-Web?

481 Views Asked by At

I'm trying to serve my web files (html+js+wasm) generated with trunk build from my server using Actix-Web by responding with

HttpResponse::Ok()
    .content_type(ContentType::html())
    .body(include_str!(r"..\..\frontend\dist\index.html"))

The browser gets the HTML, as evident by the browser F12 window, but it displays a blank page. (The page does display content when served using trunk serve).

0

There are 0 best solutions below