more frontend work to set backend port
This commit is contained in:
11
handlers.go
11
handlers.go
@@ -9,6 +9,11 @@ import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
//Get Server Config
|
||||
func (s *Server) GetServerConfig(c *fiber.Ctx) error {
|
||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{"BasicAuth": s.Config.Authentication.BasicAuth, "Timezone": s.Config.Timezone})
|
||||
}
|
||||
|
||||
// Add a new location
|
||||
func (s *Server) AddNewLocationHandler(c *fiber.Ctx) error {
|
||||
form, err := c.MultipartForm()
|
||||
@@ -72,7 +77,7 @@ func (s *Server) AddNewLocationHandler(c *fiber.Ctx) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return c.SendString(fmt.Sprintf("New Location Created! %s", newLocation.Name))
|
||||
return c.Status(fiber.StatusOK).SendString(fmt.Sprintf("New Location Created! %s", newLocation.Name))
|
||||
}
|
||||
|
||||
func (s *Server) GetAllLocationsHandler(c *fiber.Ctx) error {
|
||||
@@ -100,11 +105,11 @@ func (s *Server) GetAllLocationsHandler(c *fiber.Ctx) error {
|
||||
locArray[0] = testLoc
|
||||
locArray[1] = testLoc2
|
||||
fmt.Println("Returning TestLoc: ", locArray)
|
||||
return c.JSON(locArray)
|
||||
return c.Status(fiber.StatusOK).JSON(locArray)
|
||||
}
|
||||
|
||||
func (s *Server) DeleteLocationHandler(c *fiber.Ctx) error {
|
||||
locID := c.Params("locID")
|
||||
fmt.Println("LocID: ", locID)
|
||||
return c.JSON(locID)
|
||||
return c.Status(fiber.StatusOK).JSON(locID)
|
||||
}
|
||||
|
Reference in New Issue
Block a user