Rename App -> Server, less confusing
This commit is contained in:
parent
568fb0323e
commit
4d510e5c51
1 changed files with 6 additions and 6 deletions
|
@ -42,20 +42,20 @@ func main() {
|
|||
|
||||
database.DbConnect(conf.DbPath)
|
||||
|
||||
app := fiber.New()
|
||||
server := fiber.New()
|
||||
|
||||
app.Static("/", "./static")
|
||||
server.Static("/", "./static")
|
||||
|
||||
b := &ButtonState{PressCount: 0}
|
||||
app.Get("/api/button", b.pressHandlerGet)
|
||||
app.Post("/api/button", b.pressHandlerPost)
|
||||
app.Post("/api/project", func(c *fiber.Ctx) error {
|
||||
server.Get("/api/button", b.pressHandlerGet)
|
||||
server.Post("/api/button", b.pressHandlerPost)
|
||||
server.Post("/api/project", func(c *fiber.Ctx) error {
|
||||
return c.JSON(fiber.Map{
|
||||
"message": "Project created",
|
||||
})
|
||||
})
|
||||
|
||||
err = app.Listen(fmt.Sprintf(":%d", conf.Port))
|
||||
err = server.Listen(fmt.Sprintf(":%d", conf.Port))
|
||||
if err != nil {
|
||||
fmt.Println("Error starting server: ", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue