feat: add docker file for static server example
This commit is contained in:
parent
b7d18bfd02
commit
c43d0e7295
2 changed files with 23 additions and 3 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/zitadel/oidc/v2/example/server/exampleop"
|
||||
"github.com/zitadel/oidc/v2/example/server/storage"
|
||||
|
@ -12,8 +13,12 @@ import (
|
|||
func main() {
|
||||
//we will run on :9998
|
||||
port := "9998"
|
||||
//which gives us the issuer: http://localhost:9998/
|
||||
issuer := fmt.Sprintf("http://localhost:%s/", port)
|
||||
|
||||
issuer, ok := os.LookupEnv("ISSUER")
|
||||
if !ok {
|
||||
//which gives us the issuer: http://localhost:9998/
|
||||
issuer = fmt.Sprintf("http://localhost:%s/", port)
|
||||
}
|
||||
|
||||
// the OpenIDProvider interface needs a Storage interface handling various checks and state manipulations
|
||||
// this might be the layer for accessing your database
|
||||
|
@ -26,7 +31,7 @@ func main() {
|
|||
Addr: ":" + port,
|
||||
Handler: router,
|
||||
}
|
||||
log.Printf("server listening on http://localhost:%s/", port)
|
||||
log.Printf("server listening on %s", issuer)
|
||||
log.Println("press ctrl+c to stop")
|
||||
err := server.ListenAndServe()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue