dogs-and-capybaras-web-site/main.go
2023-10-11 20:06:22 +03:00

25 lines
447 B
Go

package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.LoadHTMLGlob("templates/*")
r.Static("/static", "./static/")
r.GET("/", func(c *gin.Context) {
c.HTML(http.StatusOK, "index.html", nil)
})
r.GET("/capybaras", func(c *gin.Context) {
c.HTML(http.StatusOK, "capybaras.html", nil)
})
r.GET("/dogs", func(c *gin.Context) {
c.HTML(http.StatusOK, "dogs.html", nil)
})
r.Run(":8080")
}