From 1535ea4f6c4a4256903b6fbf644a87692ddc7e35 Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Wed, 25 Jan 2023 06:22:12 +0100 Subject: [PATCH] chore(examples): improve logging and how to use (#266) --- README.md | 2 +- example/client/app/app.go | 1 + example/server/main.go | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e43c208..1be33e7 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Check the `/example` folder where example code for different scenarios is locate # start oidc op server # oidc discovery http://localhost:9998/.well-known/openid-configuration go run github.com/zitadel/oidc/example/server -# start oidc web client +# start oidc web client (in a new terminal) CLIENT_ID=web CLIENT_SECRET=secret ISSUER=http://localhost:9998 SCOPES="openid profile" PORT=9999 go run github.com/zitadel/oidc/example/client/app ``` diff --git a/example/client/app/app.go b/example/client/app/app.go index 34c89d2..b7f2868 100644 --- a/example/client/app/app.go +++ b/example/client/app/app.go @@ -93,5 +93,6 @@ func main() { lis := fmt.Sprintf("127.0.0.1:%s", port) logrus.Infof("listening on http://%s/", lis) + logrus.Info("press ctrl+c to stop") logrus.Fatal(http.ListenAndServe(lis, nil)) } diff --git a/example/server/main.go b/example/server/main.go index 37fbcb3..3cfd20d 100644 --- a/example/server/main.go +++ b/example/server/main.go @@ -24,6 +24,8 @@ func main() { Addr: ":" + port, Handler: router, } + log.Printf("server listening on http://localhost:%s/", port) + log.Println("press ctrl+c to stop") err := server.ListenAndServe() if err != nil { log.Fatal(err)