1
0
mirror of https://github.com/zitadel/zitadel.git synced 2024-12-17 21:37:35 +00:00

25 lines
442 B
Go
Raw Normal View History

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
}