files.go 465 B

1234567891011121314151617
  1. package controller
  2. import (
  3. "net/http"
  4. "github.com/gorilla/mux"
  5. )
  6. // @Summary Retrieve a file from the file server
  7. // @Router /meshclient/files/{filename} [get]
  8. // @Tags Meshclient
  9. // @Success 200 {body} file "file"
  10. // @Failure 404 {string} string "404 not found"
  11. func fileHandlers(r *mux.Router) {
  12. r.PathPrefix("/meshclient/files").
  13. Handler(http.StripPrefix("/meshclient/files", http.FileServer(http.Dir("./meshclient/files"))))
  14. }