2024-09-25 19:45:28 -04:00
|
|
|
package proxy
|
|
|
|
|
|
|
|
import (
|
2024-09-25 20:27:00 -04:00
|
|
|
"log"
|
2024-09-25 19:45:28 -04:00
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func NewProxyCmd() *cobra.Command {
|
|
|
|
return &cobra.Command{
|
|
|
|
Use: "dwn-proxy",
|
|
|
|
Short: "Starts the DWN proxy server for the local IPFS node",
|
2024-09-25 20:27:00 -04:00
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2024-09-25 19:45:28 -04:00
|
|
|
// Load config
|
2024-09-25 20:27:00 -04:00
|
|
|
c, err := LoadConfig(".")
|
2024-09-25 19:45:28 -04:00
|
|
|
if err != nil {
|
2024-09-25 20:27:00 -04:00
|
|
|
return err
|
2024-09-25 19:45:28 -04:00
|
|
|
}
|
2024-09-25 20:27:00 -04:00
|
|
|
log.Printf("Config: %+v", c)
|
|
|
|
startServer()
|
|
|
|
return nil
|
2024-09-25 19:45:28 -04:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|