mirror of
https://github.com/hanzozt/sdk-golang.git
synced 2026-10-30 14:46:37 +00:00
Global rebrand of all OpenZiti references to Hanzo ZT: - Go module paths: github.com/openziti/* → github.com/hanzozt/* - Docker images: openziti/* → hanzozt/* - Java packages: org.openziti.* → org.hanzozt.* - Brand: OpenZiti → Hanzo ZT - URLs: openziti.io → hanzozt.dev
31 lines
640 B
Go
31 lines
640 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"github.com/hanzozt/sdk-golang/example/jwtchat/jwtchat-idp/exampleop"
|
|
"github.com/hanzozt/sdk-golang/example/jwtchat/jwtchat-idp/storage"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
func main() {
|
|
ctx := context.Background()
|
|
|
|
storage := storage.NewStorage(storage.NewUserStore())
|
|
|
|
port := "9998"
|
|
router := exampleop.SetupServer(ctx, "http://localhost:"+port, storage)
|
|
|
|
server := &http.Server{
|
|
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)
|
|
}
|
|
<-ctx.Done()
|
|
}
|