zitadel/openapi/handler.go
Florian Forster fa9f581d56
chore(v2): move to new org (#3499)
* chore: move to new org

* logging

* fix: org rename caos -> zitadel

Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
2022-04-26 23:01:45 +00:00

25 lines
442 B
Go

package openapi
import (
"net/http"
"github.com/rakyll/statik/fs"
"github.com/rs/cors"
_ "github.com/zitadel/zitadel/openapi/statik"
)
const (
HandlerPrefix = "/openapi/v2/swagger"
)
func Start() (http.Handler, error) {
statikFS, err := fs.NewWithNamespace("swagger")
if err != nil {
return nil, err
}
handler := &http.ServeMux{}
handler.Handle("/", cors.AllowAll().Handler(http.FileServer(statikFS)))
return handler, nil
}