Started frontend
This commit is contained in:
10
html/index.html
Normal file
10
html/index.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>GiacPoints</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello web</h1>
|
||||
</body>
|
||||
</html>
|
||||
11
main.go
11
main.go
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user