feat: rename and remove swagger-ui

This commit is contained in:
Kevin Davis 2019-06-20 15:01:25 -04:00
parent ae91824557
commit c19c3645d2
2 changed files with 0 additions and 14 deletions

View File

@ -2,13 +2,11 @@ package main
import ( import (
"fmt" "fmt"
"net/http"
"os" "os"
"path" "path"
"github.com/cosmos/cosmos-sdk/x/mint" "github.com/cosmos/cosmos-sdk/x/mint"
"github.com/rakyll/statik/fs"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
@ -45,8 +43,6 @@ import (
mintclient "github.com/cosmos/cosmos-sdk/x/mint/client" mintclient "github.com/cosmos/cosmos-sdk/x/mint/client"
slashingclient "github.com/cosmos/cosmos-sdk/x/slashing/client" slashingclient "github.com/cosmos/cosmos-sdk/x/slashing/client"
stakingclient "github.com/cosmos/cosmos-sdk/x/staking/client" stakingclient "github.com/cosmos/cosmos-sdk/x/staking/client"
_ "github.com/cosmos/cosmos-sdk/client/lcd/statik"
) )
func main() { func main() {
@ -167,7 +163,6 @@ func txCmd(cdc *amino.Codec, mc []sdk.ModuleClients) *cobra.Command {
// NOTE: details on the routes added for each module are in the module documentation // NOTE: details on the routes added for each module are in the module documentation
// NOTE: If making updates here you also need to update the test helper in client/lcd/test_helper.go // NOTE: If making updates here you also need to update the test helper in client/lcd/test_helper.go
func registerRoutes(rs *lcd.RestServer) { func registerRoutes(rs *lcd.RestServer) {
registerSwaggerUI(rs)
rpc.RegisterRoutes(rs.CliCtx, rs.Mux) rpc.RegisterRoutes(rs.CliCtx, rs.Mux)
tx.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc) tx.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc)
auth.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, at.StoreKey) auth.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, at.StoreKey)
@ -179,15 +174,6 @@ func registerRoutes(rs *lcd.RestServer) {
mintrest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc) mintrest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc)
} }
func registerSwaggerUI(rs *lcd.RestServer) {
statikFS, err := fs.New()
if err != nil {
panic(err)
}
staticServer := http.FileServer(statikFS)
rs.Mux.PathPrefix("/swagger-ui/").Handler(http.StripPrefix("/swagger-ui/", staticServer))
}
func initConfig(cmd *cobra.Command) error { func initConfig(cmd *cobra.Command) error {
home, err := cmd.PersistentFlags().GetString(cli.HomeFlag) home, err := cmd.PersistentFlags().GetString(cli.HomeFlag)
if err != nil { if err != nil {