feat: implement serve mode with file watching

- Add fsnotify for file watching in serve mode
- Create watcher.go for content directory monitoring
- Update serve mode to generate initial output and watch for changes
- Add route to serve generated HTML files from output directory
- File changes trigger automatic regeneration

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
This commit is contained in:
2026-03-05 02:21:50 +01:00
parent 1d47c5a930
commit e3c6c25624
5 changed files with 84 additions and 3 deletions

View File

@@ -1,7 +1,14 @@
package main
import "github.com/gorilla/mux"
import (
"net/http"
"github.com/gorilla/mux"
)
func (s *WebServer) Routes(r *mux.Router) {
r.HandleFunc("/version", handleVersion).Methods("GET")
// Serve generated HTML files from output directory
r.PathPrefix("/").Handler(http.StripPrefix("/", http.FileServer(http.Dir(outputPath))))
}