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:
@@ -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))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user