diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/api/photos.go | 4 | ||||
| -rw-r--r-- | internal/api/url.go | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/internal/api/photos.go b/internal/api/photos.go index 2d492b1..92c5c04 100644 --- a/internal/api/photos.go +++ b/internal/api/photos.go @@ -30,8 +30,8 @@ func (s *Server) handlePhotos( DateTaken: photo.DateTaken, Width: photo.Width, Height: photo.Height, - ThumbnailURL: "/thumb/" + photo.ID, - PhotoURL: "/photo/" + photo.ID, + ThumbnailURL: thumbnailURL(photo.ID), + PhotoURL: photoURL(photo.ID), }) } diff --git a/internal/api/url.go b/internal/api/url.go new file mode 100644 index 0000000..06a944d --- /dev/null +++ b/internal/api/url.go @@ -0,0 +1,9 @@ +package api + +func thumbnailURL(id string) string { + return "/thumb/" + id +} + +func photoURL(id string) string { + return "/photo/" + id +} |