diff --git a/.gitignore b/.gitignore index e2ca916..dc60215 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,7 @@ .vscode /public +/assets -!/public/.gitkeep \ No newline at end of file +!/public/.gitkeep +!/assets/.gitkeep \ No newline at end of file diff --git a/assets/.gitkeep b/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/main.go b/main.go index 5f71f8b..cdba3e5 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,14 @@ func main() { }) r := gin.Default() r.Use(cors.Default()) - r.POST("/set-points", func(c *gin.Context) { + r.GET("/get/unique/id", func(c *gin.Context) { + var location model.Location + _ = c.BindJSON(&location) + c.Writer.Header().Set("Content-Type", "application/json") + client.Do("SET", location.Type, location.Id, "POINT", location.Lat, location.Lng) + c.JSON(200, gin.H{"status": "ok"}) + }) + r.POST("/set/point", func(c *gin.Context) { var location model.Location _ = c.BindJSON(&location) c.Writer.Header().Set("Content-Type", "application/json") @@ -41,5 +48,6 @@ func main() { } }) r.Static("/public", "./public") + r.Static("/assets", "./assets") _ = r.Run() }