forked from phc/website
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
572 B
Go
27 lines
572 B
Go
package main
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func main() {
|
|
r := gin.Default()
|
|
|
|
r.Static("/assets", "./assets")
|
|
r.Static("/blog", "./blog/public")
|
|
|
|
r.GET("/", func(c *gin.Context) {
|
|
r.SetHTMLTemplate(template.Must(template.ParseFiles("./views/base.html", "./views/home.html")))
|
|
c.HTML(http.StatusOK, "base", gin.H{})
|
|
})
|
|
r.GET("/utenti", func(c *gin.Context) {
|
|
r.SetHTMLTemplate(template.Must(template.ParseFiles("./views/base.html", "./views/utenti.html")))
|
|
c.HTML(http.StatusOK, "base", gin.H{})
|
|
})
|
|
|
|
r.Run(":8000")
|
|
}
|