-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
46 lines (38 loc) · 880 Bytes
/
main.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
package main
import (
"fmt"
"log"
"net/http"
"github.com/IAmRiteshKoushik/mercury/helpers"
"github.com/IAmRiteshKoushik/mercury/routes"
"github.com/gin-gonic/gin"
)
func InitServer() {
router := gin.New()
router.Use(gin.Logger())
// Test route
router.GET("/api/v1/test", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "Server is LIVE",
})
c.Done()
})
v1 := router.Group("/api/v1")
routes.AuthRoutes(v1)
routes.AccountRoutes(v1)
routes.ProfileRoutes(v1)
routes.EventRoutes(v1)
routes.PaymentRoutes(v1)
routes.DashboardRoutes(v1)
err := router.Run(":9000")
if err != nil {
log.Fatal("[ERROR]: Could not start server")
}
}
func main() {
helpers.GenerateRSAKeyPair(128)
access, refresh, err := helpers.GenerateTokens("riteshkoushik", "[email protected]")
fmt.Println(access)
fmt.Println(refresh)
fmt.Println(err)
}