draft shits

This commit is contained in:
2026-02-01 11:55:16 +01:00
parent d17ed8c650
commit e27aadc603
22 changed files with 1341 additions and 0 deletions

1
cmd/.#main.go Symbolic link
View File

@ -0,0 +1 @@
gator@gargantua.368651:1769498985

37
cmd/main.go Normal file
View File

@ -0,0 +1,37 @@
package main
import (
"flag"
"log"
"net/http"
"kadath.corp/git/adminoo/donniemarko/web"
"kadath.corp/git/adminoo/donniemarko/models"
)
func main() {
// Define command line flags
var help bool
rootFolder := flag.String("root", ".", "Root folder to serve files from")
listenAddr := flag.String("addr", "localhost:5555", "Address to listen on")
flag.BoolVar(&help, "help", false, "display this program usage")
flag.Parse()
if help {
flag.PrintDefaults()
return
}
// Initialize the directory manager
dm := models.NewTree(*rootFolder)
go dm.MonitorFileChange()
tm := web.NewTemplateManager("web/templates")
rh := web.NewRouteHandler(dm, tm)
rh.SetupRoutes()
log.Printf("Serving on http://%s", *listenAddr)
http.ListenAndServe(*listenAddr, nil)
}