30 lines
636 B
Go
30 lines
636 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"preston-baxter.com/capstone/frontend-service/templates"
|
|
)
|
|
|
|
func main() {
|
|
r := gin.Default()
|
|
r.GET("/", func(c *gin.Context) {
|
|
raw := []byte{}
|
|
buf := bytes.NewBuffer(raw)
|
|
templates.LandingPage(false).Render(c.Request.Context(), buf)
|
|
|
|
|
|
c.Data(200, "text/html", []byte(buf.String()))
|
|
})
|
|
r.GET("/login", func(c *gin.Context) {
|
|
raw := []byte{}
|
|
buf := bytes.NewBuffer(raw)
|
|
templates.LoginPage().Render(c.Request.Context(), buf)
|
|
|
|
|
|
c.Data(200, "text/html", []byte(buf.String()))
|
|
})
|
|
r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
|
|
}
|