2023-10-23 22:01:09 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-10-28 00:44:22 -04:00
|
|
|
"bytes"
|
2023-10-23 22:01:09 -04:00
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
2023-10-28 00:44:22 -04:00
|
|
|
"preston-baxter.com/capstone/frontend-service/templates"
|
2023-10-23 22:01:09 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
r := gin.Default()
|
|
|
|
r.GET("/", func(c *gin.Context) {
|
2023-10-28 00:44:22 -04:00
|
|
|
raw := []byte{}
|
|
|
|
buf := bytes.NewBuffer(raw)
|
2023-10-28 11:15:42 -04:00
|
|
|
templates.LandingPage(false).Render(c.Request.Context(), buf)
|
2023-10-28 00:44:22 -04:00
|
|
|
|
|
|
|
|
2023-10-28 12:34:11 -04:00
|
|
|
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)
|
|
|
|
|
|
|
|
|
2023-10-28 00:44:22 -04:00
|
|
|
c.Data(200, "text/html", []byte(buf.String()))
|
2023-10-23 22:01:09 -04:00
|
|
|
})
|
|
|
|
r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
|
|
|
|
}
|