start server
This commit is contained in:
@@ -28,6 +28,7 @@ func NewApiController(as *service.ApiService, routeGroups *common.RouteGroups) *
|
||||
}
|
||||
|
||||
routeGroups.Api.Get("", ac.getFirst)
|
||||
routeGroups.Api.Post("", ac.startServer)
|
||||
|
||||
return ac
|
||||
}
|
||||
@@ -43,3 +44,19 @@ func (ac *ApiController) getFirst(c *fiber.Ctx) error {
|
||||
apiModel := ac.service.GetFirst(c)
|
||||
return c.SendString(apiModel)
|
||||
}
|
||||
|
||||
// startServer returns API
|
||||
//
|
||||
// @Summary Return API
|
||||
// @Description Return API
|
||||
// @Tags api
|
||||
// @Success 200 {array} string
|
||||
// @Router /v1/api [post]
|
||||
func (ac *ApiController) startServer(c *fiber.Ctx) error {
|
||||
c.Locals("service", "ACC-Server")
|
||||
apiModel, err := ac.service.StartServer(c)
|
||||
if err != nil {
|
||||
return c.SendStatus(400)
|
||||
}
|
||||
return c.SendString(apiModel)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user