19 lines
344 B
Go
19 lines
344 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
func SetupRoutes(r *gin.Engine) {
|
||
|
r.LoadHTMLFiles("templates/index.html")
|
||
|
r.GET("/", func(c *gin.Context) {
|
||
|
c.Redirect(http.StatusFound, "/index")
|
||
|
})
|
||
|
r.GET("/index", func(c *gin.Context) {
|
||
|
c.HTML(http.StatusOK, "index.html", nil)
|
||
|
})
|
||
|
r.Static("/assets", "./assets")
|
||
|
}
|