frontend to backend communication working, starting on locations page
This commit is contained in:
7
main.go
7
main.go
@@ -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)
|
||||
|
Reference in New Issue
Block a user