feat(api): add file listing endpoint

- Add GET /api endpoint to list all markdown files
- Filter to only include .md files
- Return JSON response with files array
- Add comprehensive tests for file listing functionality
This commit is contained in:
2026-02-06 21:23:59 -05:00
parent 2a9e793971
commit a074f5a854
4 changed files with 224 additions and 193 deletions

View File

@@ -31,6 +31,7 @@ func NewServer(host string, port int, handler http.Handler, log *logrus.Logger)
func (s *Server) Start() error {
router := mux.NewRouter()
router.Handle("/api", s.handler).Methods("GET")
router.Handle("/api/{filename:.+.md}", s.handler)
router.PathPrefix("/").Handler(http.FileServer(http.Dir("frontend/dist")))