mirror of
https://github.com/KevinMidboe/planetposen-images.git
synced 2025-10-29 13:20:11 +00:00
App for fetching and uploading images to cloud bucket storage
This commit is contained in:
19
server/router.go
Normal file
19
server/router.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/kevinmidboe/planetposen-images/server/handler"
|
||||
)
|
||||
|
||||
const v1API string = "/api/v1"
|
||||
|
||||
func (s *Server) setupRoutes() {
|
||||
s.Router.HandleFunc("/_healthz", handler.Healthz).Methods("GET").Name("Health")
|
||||
|
||||
api := s.Router.PathPrefix(v1API).Subrouter()
|
||||
api.HandleFunc("/images", handler.UploadImages(s.Config.Hostname, s.GCSClient)).Methods("POST").Name("UploadImages")
|
||||
api.HandleFunc("/images", handler.ListImages(s.GCSClient)).Methods("GET").Name("ListImages")
|
||||
|
||||
// Raw image fetcher
|
||||
api.HandleFunc("/images/{path}", handler.FetchImage(s.GCSClient)).Methods("GET").Name("FetchImage")
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user