Added support for fetching character images from the server
This commit is contained in:
@@ -26,3 +26,13 @@ func (i *IndexHandler) GetDBTest(ctx echo.Context) error {
|
||||
backend.TestDB()
|
||||
return ctx.JSON(http.StatusOK, "TestedDB")
|
||||
}
|
||||
|
||||
func (i *IndexHandler) GetCharacters(ctx echo.Context) error {
|
||||
characters := backend.GetCharacters()
|
||||
return ctx.JSON(http.StatusOK, characters)
|
||||
}
|
||||
|
||||
func (i *IndexHandler) GetCharacter(ctx echo.Context) error {
|
||||
character := ctx.QueryParam("character")
|
||||
return ctx.File(backend.GetCharacter(character))
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ func (s *Server) RegisterRoutes() http.Handler {
|
||||
index := NewIndexHandler()
|
||||
e.GET("/version", index.GetVersion)
|
||||
e.GET("/health", index.GetDBTest)
|
||||
e.GET("/character", index.GetCharacter)
|
||||
e.GET("/characters", index.GetCharacters)
|
||||
|
||||
sync := NewSyncHandler()
|
||||
syncGroup := e.Group("/sync")
|
||||
|
||||
Reference in New Issue
Block a user