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