-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.go
50 lines (36 loc) · 800 Bytes
/
server.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"fmt"
Controllers "github.com/electra-systems/athena/controllers"
Utils "github.com/electra-systems/athena/utils"
"github.com/go-redis/redis"
"github.com/gin-gonic/gin"
)
type UserLocationData struct {
Id string `json:"id"`
Lat string `json:"lat"`
Lng string `json:"lng"`
}
var userClient = redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "",
DB: 1,
})
var carClient = redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "",
DB: 2,
})
func print(data ...interface{}) {
fmt.Println(data)
}
func Server() {
r := gin.Default()
r.Use(Utils.CORSMiddleware())
r.GET("/", Controllers.ServeBasicView)
r.POST("/index-location", Controllers.IndexLocation)
r.Run()
}
func main() {
Server()
}