-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
37 lines (30 loc) · 849 Bytes
/
Copy pathmain.go
File metadata and controls
37 lines (30 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"github.com/gofiber/swagger"
"github.com/gofiber/fiber/v2"
"github.com/plusiv/fiber-todo-api/database"
_ "github.com/plusiv/fiber-todo-api/docs"
"github.com/plusiv/fiber-todo-api/router"
)
// @title Fiber ToDo API
// @version 1.0
// @description Sample API for creating ToDos tasks.
// @termsOfService http://swagger.io/terms/
// @contact.name Jorge Massih
// @contact.email jorgmassih@gmail.com
// @license.name MIT
// @license.url https://github.com/plusiv/fiber-todo-api/blob/main/LICENSE
// @host localhost:8080
// @BasePath /
func main() {
app := fiber.New()
// Connect with database
database.ConnectDB()
router.SetupRouter(app)
app.Get("/ping", func(c *fiber.Ctx) (err error) {
err = c.SendString("pong")
return
})
app.Get("/docs/*", swagger.HandlerDefault) // default
app.Listen(":3000")
}