frontend to backend communication working, starting on locations page

This commit is contained in:
2021-12-08 23:11:50 -05:00
parent ce38e21dca
commit 41f6b5873c
18 changed files with 341 additions and 124 deletions

View File

@@ -77,11 +77,14 @@ func main() {
PathPrefix: "static",
}))
// Serve up our static images
server.WebServer.Static("/photos", "./app/photos")
// Load in our routes
server.WebServer.Get("/hello", func(c *fiber.Ctx) error { // Basic Hello Route
return c.SendString("GoInventorize Backend Hello Route!")
})
// Location Routes
// Unauthenticated config route to fetch the config
server.WebServer.Get("/config", server.GetServerConfig)
// Setup our basic authentication if defined
if server.Config.Authentication.BasicAuth {
@@ -91,7 +94,7 @@ func main() {
},
}))
}
// Location Routes
server.WebServer.Get("/locations", server.GetAllLocationsHandler)
server.WebServer.Post("/locations/new", server.AddNewLocationHandler)
server.WebServer.Delete("/locations/:locID", server.DeleteLocationHandler)