init: Initial commit
This commit is contained in:
29
app/main.go
Normal file
29
app/main.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"git.secnex.io/secnex/api-gateway/config"
|
||||
"git.secnex.io/secnex/api-gateway/server"
|
||||
"git.secnex.io/secnex/masterlog"
|
||||
)
|
||||
|
||||
func main() {
|
||||
masterlog.SetLevel(masterlog.LevelDebug)
|
||||
masterlog.AddEncoder(&masterlog.JSONEncoder{})
|
||||
pseudonymizer := masterlog.NewPseudonymizerFromString("your-secret-key")
|
||||
masterlog.SetPseudonymizer(pseudonymizer)
|
||||
masterlog.AddSensitiveFields("user_id", "email", "ip")
|
||||
|
||||
cfg, err := config.NewFileConfig("../gateway.yaml")
|
||||
if err != nil {
|
||||
masterlog.Error("Failed to load config", map[string]interface{}{
|
||||
"error": err,
|
||||
})
|
||||
os.Exit(1)
|
||||
}
|
||||
gateway := server.NewGateway(cfg)
|
||||
routes := server.NewRoutes(cfg.GetRoutes(), cfg.GetApis())
|
||||
gateway.SetRoutes(routes)
|
||||
gateway.Start()
|
||||
}
|
||||
Reference in New Issue
Block a user