Added empty api functions
This commit is contained in:
34
main.go
34
main.go
@@ -1,16 +1,36 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"github.com/gin-gonic/gin"
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func handler(w http.ResponseWriter, r *http.Request) {
|
func login(c *gin.Context) {
|
||||||
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
|
// log the user into their account
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTasks(c *gin.Context) {
|
||||||
|
// return a list of all of the tasks
|
||||||
|
}
|
||||||
|
|
||||||
|
func completeTask(c *gin.Context) {
|
||||||
|
// complete a task in the history log
|
||||||
|
}
|
||||||
|
|
||||||
|
func getHistory(c *gin.Context) {
|
||||||
|
// get the log of past points gained
|
||||||
|
}
|
||||||
|
|
||||||
|
func addTask(c *gin.Context) {
|
||||||
|
// add a task to the list of tasks
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
http.HandleFunc("/", handler)
|
router := gin.Default()
|
||||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
router.POST("/login", login)
|
||||||
|
router.GET("/getTasks", getTasks)
|
||||||
|
router.POST("/completeTask", completeTask)
|
||||||
|
router.POST("/addTask", addTask)
|
||||||
|
router.GET("/getHistory", getHistory)
|
||||||
|
|
||||||
|
router.Run("localhost:8080")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user