Serve Template and Static

This commit is contained in:
Samuel Lorch 2024-05-04 01:31:24 +02:00
parent e51abbcbf7
commit b2761970ce
4 changed files with 85 additions and 8 deletions

10
main.go
View file

@ -5,12 +5,20 @@ import (
"log/slog"
"os"
"embed"
"git.lastassault.de/speatzle/morffix/config"
"git.lastassault.de/speatzle/morffix/server"
"git.lastassault.de/speatzle/morffix/worker"
"github.com/BurntSushi/toml"
)
//go:embed tmpl
var templates embed.FS
//go:embed static
var static embed.FS
var conf config.Config
func main() {
@ -31,7 +39,7 @@ func main() {
if *isserver {
slog.Info("Starting Server...")
server.Start(conf)
server.Start(conf, templates, static)
} else {
slog.Info("Starting Worker...")
worker.Start(conf)