diff --git a/process/handlers.go b/process/handlers.go index 48acf0f..972d9c0 100644 --- a/process/handlers.go +++ b/process/handlers.go @@ -88,6 +88,10 @@ func (a *Server) getInstanceListHandler() http.HandlerFunc { } */ +func (a *Server) notFoundHandler(c echo.Context) error { + return c.String(http.StatusNotFound, "404 not found") +} + func (a *Server) instanceHandler(c echo.Context) error { tu := c.Param("uuid") u, err := uuid.Parse(tu) @@ -103,6 +107,12 @@ func (a *Server) instanceHandler(c echo.Context) error { } } + _, exists := tc["instance"] + + if !exists { + return a.notFoundHandler(c) + } + return c.Render(http.StatusOK, "instance.html", tc) }