Add in a few middlewares I need.
This commit is contained in:
parent
8c04bffa5d
commit
81aaffec56
2 changed files with 9 additions and 1 deletions
8
main.go
8
main.go
|
@ -10,6 +10,11 @@ import (
|
|||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/jmoiron/sqlx"
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
"github.com/gofiber/fiber/v2/middleware/recover"
|
||||
"github.com/gofiber/fiber/v2/middleware/encryptcookie"
|
||||
"github.com/gofiber/fiber/v2/middleware/session"
|
||||
"github.com/gofiber/fiber/v2/middleware/helmet"
|
||||
"github.com/gofiber/fiber/v2/middleware/basicauth"
|
||||
)
|
||||
|
||||
type Link struct {
|
||||
|
@ -34,11 +39,14 @@ func main() {
|
|||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
store := session.New()
|
||||
|
||||
engine := html.New("./views", ".html")
|
||||
app := fiber.New(fiber.Config{
|
||||
Views: engine,
|
||||
})
|
||||
app.Use(logger.New())
|
||||
app.Use(recover.New())
|
||||
|
||||
// handler that returns one json from a sql database
|
||||
app.Get("/api/stream/", func (c *fiber.Ctx) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue