Files
Carl Pearson fa7c416f66 Initial commit
2025-05-30 05:35:27 -06:00

20 lines
377 B
Go

package handlers
import (
"net/http"
"git.sr.ht/~cwpearson/replicate-jump-server/store"
"github.com/labstack/echo/v4"
)
func ImageGet(c echo.Context) error {
id := c.Param("id")
image, exists := store.Get(id)
if !exists {
return echo.NewHTTPError(http.StatusNotFound, "Image not found or expired")
}
return c.Blob(http.StatusOK, image.ContentType, image.Data)
}