We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcf514a commit d33a4f6Copy full SHA for d33a4f6
.env
@@ -1,4 +1,4 @@
1
ACCESS_SECRET=hello
2
-RedisAddr=REDIS_DB=localhost:6379
+RedisAddr=localhost:6379
3
GIN_PORT=8080
4
REFRESH_SECRET=hello
config/init.go
@@ -0,0 +1,13 @@
+package config
+
+import (
+ "github.com/HelpDeskPlatform/gin-jwt/db"
5
+ "log"
6
+)
7
8
+func InIt() {
9
+ SetEnvironment()
10
+ if err := db.NewDatabase(RedisAddr); err != nil {
11
+ log.Println(err)
12
+ }
13
+}
main.go
@@ -21,13 +21,6 @@ func initEnv() {
21
}
22
23
24
-func InIt() {
25
- config.SetEnvironment()
26
- if err := db.NewDatabase(config.RedisAddr); err != nil {
27
- log.Println(err)
28
- }
29
-}
30
-
31
func init() {
32
initEnv()
33
0 commit comments