aboutsummaryrefslogtreecommitdiff
path: root/internal/api/new.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/new.go')
-rw-r--r--internal/api/new.go21
1 files changed, 17 insertions, 4 deletions
diff --git a/internal/api/new.go b/internal/api/new.go
index a7c122b..7febfe7 100644
--- a/internal/api/new.go
+++ b/internal/api/new.go
@@ -11,10 +11,13 @@ func New(config Config) *Server {
}
srv := &Server{
- config: config,
- mux: mux,
- http: server,
- gallery: config.Gallery,
+ config: config,
+
+ mux: mux,
+ http: server,
+
+ gallery: config.Gallery,
+ thumbnails: config.Thumbnails,
}
srv.mux.HandleFunc(
@@ -27,5 +30,15 @@ func New(config Config) *Server {
srv.handlePhotos,
)
+ srv.mux.HandleFunc(
+ "GET /thumb/{id}",
+ srv.handleThumbnail,
+ )
+
+ srv.mux.HandleFunc(
+ "GET /photo/{id}",
+ srv.handlePhoto,
+ )
+
return srv
}