Swagger definition URL now based on config.json Addr field

This commit is contained in:
Christoph Kluge 2022-09-27 10:33:36 +02:00
parent 5f50a00784
commit 21b03d02b2
2 changed files with 2 additions and 2 deletions

View File

@ -291,7 +291,7 @@ func main() {
if flagDev { if flagDev {
r.Handle("/playground", playground.Handler("GraphQL playground", "/query")) r.Handle("/playground", playground.Handler("GraphQL playground", "/query"))
r.PathPrefix("/swagger/").Handler(httpSwagger.Handler( r.PathPrefix("/swagger/").Handler(httpSwagger.Handler(
httpSwagger.URL("http://localhost:8080/swagger/doc.json"))).Methods(http.MethodGet) httpSwagger.URL("http://" + config.Keys.Addr + "/swagger/doc.json"))).Methods(http.MethodGet)
} }
secured.Handle("/query", graphQLEndpoint) secured.Handle("/query", graphQLEndpoint)

View File

@ -14,7 +14,7 @@ import (
) )
var Keys schema.ProgramConfig = schema.ProgramConfig{ var Keys schema.ProgramConfig = schema.ProgramConfig{
Addr: ":8080", Addr: "localhost:8080",
DisableAuthentication: false, DisableAuthentication: false,
EmbedStaticFiles: true, EmbedStaticFiles: true,
DBDriver: "sqlite3", DBDriver: "sqlite3",