Use go-chi v5
This commit is contained in:
@ -67,6 +67,9 @@ func getServiceContainer(ctx context.Context, conf *config.Config) (*service.Con
|
||||
conf.HTTP.TemplateDir,
|
||||
))
|
||||
|
||||
// Create and expose config service provider
|
||||
ctn.Provide(config.ServiceName, config.ServiceProvider(conf))
|
||||
|
||||
defaultHTTPTransport, ok := http.DefaultTransport.(*http.Transport)
|
||||
if ok {
|
||||
if defaultHTTPTransport.TLSClientConfig == nil {
|
||||
@ -81,9 +84,6 @@ func getServiceContainer(ctx context.Context, conf *config.Config) (*service.Con
|
||||
)
|
||||
}
|
||||
|
||||
// Create and expose config service provider
|
||||
ctn.Provide(config.ServiceName, config.ServiceProvider(conf))
|
||||
|
||||
provider, err := oidc.NewProvider(ctx, conf.OIDC.IssuerURL)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not create oidc provider")
|
||||
|
@ -2,21 +2,19 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"forge.cadoles.com/wpetit/goweb-oidc/internal/config"
|
||||
"forge.cadoles.com/wpetit/goweb-oidc/internal/route"
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
"github.com/go-chi/chi/middleware"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"gitlab.com/wpetit/goweb/middleware/container"
|
||||
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"os"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"gitlab.com/wpetit/goweb/logger"
|
||||
)
|
||||
@ -89,7 +87,6 @@ func main() {
|
||||
} else {
|
||||
conf = config.NewDefault()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Dump configuration if asked
|
||||
@ -140,6 +137,7 @@ func main() {
|
||||
r := chi.NewRouter()
|
||||
|
||||
// Define base middlewares
|
||||
r.Use(middleware.CleanPath)
|
||||
r.Use(middleware.Logger)
|
||||
r.Use(middleware.Recoverer)
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="column is-4-tablet is-8-mobile">
|
||||
<div class="columns is-mobile is-gapless">
|
||||
<div class="column is-narrow">
|
||||
<h1 class="is-size-3 title"><a href="{{ .BaseURL }}" rel="Homepage" class="has-text-black">OIDC Test App</a></h1>
|
||||
<h1 class="is-size-3 title"><a href="{{ .BaseURL }}" rel="Homepage" class="has-text-black">OIDC Tester</a></h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{define "title"}}Home | OIDC Test App{{end}}
|
||||
{{define "title"}}Home | OIDC Tester{{end}}
|
||||
{{define "body"}}
|
||||
<section class="home is-fullheight section">
|
||||
<div class="container">
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{define "title"}}Profile | OIDC Test App{{end}}
|
||||
{{define "title"}}Profile | OIDC Tester{{end}}
|
||||
{{define "body"}}
|
||||
<section class="home is-fullheight section">
|
||||
<div class="container">
|
||||
|
Reference in New Issue
Block a user