Server A Local Static Website From A Tauri App
This is what I'm doing to run an Actix web server from a Tauri app.
Code
Cargo.toml
[package]
name = "tauri_as_web_server"
version = "0.0.1"
description = "Tauri As A Web Server"
license = "MIT"
edition = "2021"
[build-dependencies]
tauri-build = { version = "1.5", features = [] }
[dependencies]
tauri = { version = "1.5", features = ["shell-open"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
actix-web = "4"
actix-files = "0.6.5"
[features]
# this feature is used for production builds or when `devPath` points to the filesystem
# DO NOT REMOVE!!
custom-protocol = ["tauri/custom-protocol"]
Code
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
use actix_files as fs;
use get;
use App;
use HttpResponse;
use HttpServer;
use Responder;
async