Started frontend

This commit is contained in:
2023-07-16 18:43:58 +01:00
parent a85e63a327
commit eb62c78624
2 changed files with 21 additions and 0 deletions

11
main.go
View File

@@ -161,12 +161,23 @@ func addTask(c *gin.Context) {
func main() {
router := gin.Default()
// api routes
router.POST("/login", login)
router.POST("/completeTask", completeTask)
router.POST("/addTask", addTask)
router.GET("/getTasks", getTasks)
router.GET("/getHistory", getHistory)
// page routes
router.LoadHTMLGlob("html/*")
router.GET("/", func(c *gin.Context) {
c.HTML(http.StatusOK, "index.html", gin.H{})
})
// asset routes
router.Static("/scripts", "./scripts")
router.Run("localhost:8080")
}