@@ -5,28 +5,19 @@ import (
5
5
"net/http"
6
6
"os"
7
7
"strconv"
8
-
9
- "github.com/redis/go-redis/v9"
10
- "github.com/go-chi/chi/v5"
11
- "github.com/dash-xd/logma/internal/app"
8
+ "github.com/dash-xd/logma2/internal/app"
12
9
)
13
10
14
- func main () {
15
- fmt .Printf ("Starting server...\n " )
16
- redisClient := redis .NewClient (& redis.Options {
17
- Addr : os .Getenv ("REDIS_URI" ),
18
- Password : os .Getenv ("REDISCLI_AUTH" ),
19
- DB : 0 ,
20
- })
21
- defer redisClient .Close ()
22
- entityRegistrar := entity .NewRedisEntityRegistrar (redisClient )
23
- router := app .NewRouter (redisClient , entityRegistrar )
24
- port := getPortFromArgs ()
25
- addr := fmt .Sprintf (":%d" , port )
26
- fmt .Printf ("Go Server is listening on http://localhost%s\n " , addr )
27
- if err := http .ListenAndServe (addr , router ); err != nil {
28
- panic (err )
29
- }
11
+ func main (){
12
+ fmt .Printf ("starting server ... " )
13
+ router := app .NewRouter ()
14
+ port := getPortFromArgs ()
15
+ addr := fmt .Sprintf (":%d" , port )
16
+ fmt .Printf ("Go Server is listening on http://localhost%s\n " , addr )
17
+ err := http .ListenAndServe (addr , router )
18
+ if err != nil {
19
+ panic (err )
20
+ }
30
21
}
31
22
32
23
func getPortFromArgs () int {
0 commit comments