Files
go-cv/routes.go
Bryan Joshua Pedini e3c6c25624 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>
2026-03-05 02:21:50 +01:00

15 lines
310 B
Go

package main
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))))
}