Skip to content

Commit

Permalink
registering statik namespace with "terrad" (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
kien6034 authored Nov 27, 2024
1 parent 1de4dd8 commit 5e06beb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ gen-swagger-docs:
bash scripts/protoc-swagger-gen.sh

update-swagger-docs: statik
$(BINDIR)/statik -src=client/docs/swagger-ui -dest=client/docs -f -m
$(BINDIR)/statik -src=client/docs/swagger-ui -dest=client/docs -f -m -ns terrad
@if [ -n "$(git status --porcelain)" ]; then \
echo "Swagger docs are out of sync!";\
exit 1;\
Expand Down
3 changes: 1 addition & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,10 @@ func (app *TerraApp) RegisterNodeService(clientCtx client.Context) {

// RegisterSwaggerAPI registers swagger route with API Server
func RegisterSwaggerAPI(rtr *mux.Router) {
statikFS, err := fs.New()
statikFS, err := fs.NewWithNamespace("terrad")
if err != nil {
panic(err)
}

staticServer := http.FileServer(statikFS)
rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer))
}
Expand Down
9 changes: 6 additions & 3 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

0 comments on commit 5e06beb

Please sign in to comment.