1
0
mirror of https://github.com/nitezs/sub2sing-box.git synced 2024-12-23 14:24:42 -05:00
sub2sing-box/cmd/server.go

24 lines
395 B
Go
Raw Permalink Normal View History

2024-03-11 13:34:08 -04:00
package cmd
import (
2024-09-19 06:12:24 -04:00
"github.com/nitezs/sub2sing-box/api"
2024-03-11 13:34:08 -04:00
"github.com/spf13/cobra"
)
var port uint16
func init() {
runCmd.Flags().Uint16VarP(&port, "port", "p", 8080, "server port")
RootCmd.AddCommand(runCmd)
}
var runCmd = &cobra.Command{
Use: "server",
Long: "Run the server",
Short: "Run the server",
Run: func(cmd *cobra.Command, args []string) {
api.RunServer(port)
},
}