nova-rebolaxe/server.go

26 lines
515 B
Go
Raw Normal View History

2023-12-04 16:59:57 +01:00
package main
import (
"fmt"
"log"
"tr4ck.net/htmx-poc/vistas"
"github.com/gin-gonic/gin"
)
func main() {
router := gin.Default()
router.LoadHTMLGlob("web/**/*")
router.Static("/css", "./web/css")
router.Static("/js", "./web/js")
router.GET("/", vistas.Index)
router.GET("/health", vistas.Health)
router.POST("/buscador", vistas.Buscador)
router.POST("/letra", vistas.Letra)
bind := ":8080"
fmt.Println("Listening on " + bind)
log.Fatal(router.Run(bind))
}