diff options
| author | Saiyed Shizain <saiyedshizain@gmail.com> | 2026-07-13 19:45:40 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-13 19:45:40 +0530 |
| commit | 5d4eaf85434658f6fed621016e0bc2bae59e88d1 (patch) | |
| tree | 93ec34c177b6a48d90d5024313c3a10f5b7c5d2b /internal/api/new.go | |
| parent | f41b0b92046e1bee512b3e4143ed9dc9a9ba9713 (diff) | |
| parent | 8e8f0bd38f0cc0ee435ae2ed392a206e1ea73a32 (diff) | |
| download | galleryd-5d4eaf85434658f6fed621016e0bc2bae59e88d1.tar.xz galleryd-5d4eaf85434658f6fed621016e0bc2bae59e88d1.zip | |
Merge pull request #8 from RanXom/feat/api
Feat/api: expose gallery HTTP API
Diffstat (limited to 'internal/api/new.go')
| -rw-r--r-- | internal/api/new.go | 21 |
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 } |