Merge branch '9-issue' into 'main'
Resolve "add health path in lib" Closes #9 See merge request h6n/users!11
This commit is contained in:
commit
51de27f294
2 changed files with 12 additions and 5 deletions
|
|
@ -40,10 +40,6 @@ func isLoggedIn(c echo.Context) error {
|
|||
return c.NoContent(http.StatusNoContent)
|
||||
}
|
||||
|
||||
func status(c echo.Context) error {
|
||||
return c.NoContent(http.StatusOK)
|
||||
}
|
||||
|
||||
func init_database() {
|
||||
var err error
|
||||
|
||||
|
|
@ -104,7 +100,7 @@ func main() {
|
|||
e.GET("/", isLoggedIn)
|
||||
e.POST("/", login)
|
||||
e.DELETE("/", logout)
|
||||
e.GET("/health", status)
|
||||
e.GET("/health", health.Health)
|
||||
e.GET("/swagger/*", echoSwagger.WrapHandler)
|
||||
|
||||
// Start server
|
||||
|
|
|
|||
11
lib/health/status.go
Normal file
11
lib/health/status.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package health
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func Health(c echo.Context) error {
|
||||
return c.NoContent(http.StatusOK)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue