-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathletu-http.go
52 lines (41 loc) · 975 Bytes
/
letu-http.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
51
52
package main
import (
"os"
"fmt"
"goldapple"
"gopkg.in/mgo.v2"
"github.com/gin-gonic/gin"
"github.com/blackjack/syslog"
)
const (
C_HOST = "0.0.0.0"
C_PORT = "8804"
C_TYPE = "tcp"
)
const ENV_PREF = "prod"
const BrandCollection = "letu_brands"
var DB string = os.Getenv("LETU_MONGO_DB")
func main() {
r := gin.Default()
// Start parser
r.GET("/v1/check/:user", func(c *gin.Context) {
name := c.Param("name")
})
// Parse single product page
r.GET("/v1/single_product", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "r.GET(\"/single_product\", func(c *gin.Context)",
})
})
// Parse single product page
r.GET("/v1/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
// Parse single product page
r.GET("/", func(c *gin.Context) {
c.String(200, "GASec")
})
r.Run(":"+C_PORT)
}