Fix: Switch gin mode depending on aptly.EnableDebug

If aptly.EnableDebug is active, we use Debug, otherwise we use
gin.ReleaseMode to remove the annoying nuding messages when running the
api.

fixes: #1103
This commit is contained in:
Mauro Regli
2023-03-07 11:35:22 +01:00
committed by Benj Fassbind
parent 8e62195eb5
commit c187b0d52c
3 changed files with 12 additions and 0 deletions
+4
View File
@@ -89,6 +89,10 @@ func (s *ApiSuite) HTTPRequest(method string, url string, body io.Reader) (*http
return w, nil
}
func (s *ApiSuite) TestGinRunsInReleaseMode(c *C) {
c.Check(gin.Mode(), Equals, gin.ReleaseMode)
}
func (s *ApiSuite) TestGetVersion(c *C) {
response, err := s.HTTPRequest("GET", "/api/version", nil)
c.Assert(err, IsNil)