Add full monorepo: virtual-banker, backend, frontend, docs, scripts, deployment
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
32
backend/api/gateway/cmd/main.go
Normal file
32
backend/api/gateway/cmd/main.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/explorer/backend/api/gateway"
|
||||
)
|
||||
|
||||
func main() {
|
||||
apiURL := os.Getenv("API_URL")
|
||||
if apiURL == "" {
|
||||
apiURL = "http://localhost:8080"
|
||||
}
|
||||
|
||||
gw, err := gateway.NewGateway(apiURL)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create gateway: %v", err)
|
||||
}
|
||||
|
||||
port := 8081
|
||||
if envPort := os.Getenv("GATEWAY_PORT"); envPort != "" {
|
||||
if p, err := strconv.Atoi(envPort); err == nil {
|
||||
port = p
|
||||
}
|
||||
}
|
||||
|
||||
if err := gw.Start(port); err != nil {
|
||||
log.Fatalf("Failed to start gateway: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user