MCPcopy Create free account
hub / github.com/aurora-develop/Duck2api / main

Function main

main.go:13–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11)
12
13func main() {
14 _ = godotenv.Load(".env")
15 gin.SetMode(gin.ReleaseMode)
16 router := initialize.RegisterRouter()
17 host := os.Getenv("SERVER_HOST")
18 port := os.Getenv("SERVER_PORT")
19 tlsCert := os.Getenv("TLS_CERT")
20 tlsKey := os.Getenv("TLS_KEY")
21
22 if host == "" {
23 host = "0.0.0.0"
24 }
25 if port == "" {
26 port = os.Getenv("PORT")
27 if port == "" {
28 port = "8080"
29 }
30 }
31
32 if tlsCert != "" && tlsKey != "" {
33 _ = endless.ListenAndServeTLS(host+":"+port, tlsCert, tlsKey, router)
34 } else {
35 _ = endless.ListenAndServe(host+":"+port, router)
36 }
37}

Callers

nothing calls this directly

Calls 1

RegisterRouterFunction · 0.92

Tested by

no test coverage detected