A small project that collects various nice things to get started with Go Web Development.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-web-starter-kit/api/handlers.go

32 lines
611 B

package api
import (
"log"
"time"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/session"
)
var STORE *session.Store
func Setup(app *fiber.App) {
STORE = session.New()
// this forces static pages to reload
app.Static("/", "./public", fiber.Static{
Compress: false,
CacheDuration: 1 * time.Nanosecond,
})
// api/auth.go
app.Get("/api/authcheck", GetApiAuthCheck)
app.Get("/api/logout", GetApiLogout)
app.Post("/api/register", PostApiRegister)
app.Post("/api/login", PostApiLogin)
}
func Shutdown() {
log.Println("Shutting down controllers...")
}