mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
feat: rename and remove swagger-ui
This commit is contained in:
parent
ae91824557
commit
c19c3645d2
@ -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 {
|
Loading…
Reference in New Issue
Block a user