.expect("Unable to compile SASS file, install SASS, see https://sass-lang.com/")
}
+ // Create static directory if it doesn't exist.
+ if !Path::new("static").exists() {
+ std::fs::create_dir("static");
+ }
+
let output =
if exists_in_path("sass.bat") {
run_sass(Command::new("cmd").args(&["/C", "sass.bat"]))
async fn main_page(/*key_shared: web::Data<Mutex<String>>,*/ query: Query<Request>) -> impl Responder {
//let key = key_shared.lock().unwrap();
- let m = String::from("hello");
+ let m =
+ if valheim_controller::is_valheim_running() { String::from("Valheim server is up and running") } else { String::from("Valheim server is down :(") };
+
MainTemplate { sentence: m }
}
+#!/usr/bin/env pwsh
+
if ($args.Count -lt 1) {
$scriptName = [Environment]::GetCommandLineArgs()[1]
Write-Output "Usage: $scriptName <destination>"
git pull
cargo build --release
-systemctl --user stop valheim-web
+systemctl --user stop valheim_web
$destination=$args[0]
New-Item -ItemType directory -Path $destination
}
-strip target/release/valheim-web # To reduce the executable size.
-Copy-Item target/release/valheim-web -Destination $destination
+strip target/release/valheim_web # To reduce the executable size.
+Copy-Item target/release/valheim_web -Destination $destination
-Copy-Item static -Destination $destination -Recurse -Force
+Copy-Item backend/static -Destination $destination -Recurse -Force
# Do not overwrite the configuration.
if (!(Test-Path -Path $destination/conf.ron)) {
- Copy-Item conf.ron -Destination $destination
+ Copy-Item backend/conf.ron -Destination $destination
}
-systemctl --user start valheim-web
+systemctl --user start valheim_web
--- /dev/null
+[Unit]
+Description=valheim_web
+
+[Service]
+WorkingDirectory=/var/www/valheim_web
+ExecStart=/var/www/valheim_web/valheim_web
+SyslogIdentifier=valheim_web
+Restart=always
+RestartSec=10
+KillSignal=SIGINT
+
+[Install]
+WantedBy=default.target
+