| 1 | // SPDX-License-Identifier: AGPL-3.0-or-later |
| 2 | |
| 3 | package main |
| 4 | |
| 5 | import ( |
| 6 | "github.com/spf13/cobra" |
| 7 | |
| 8 | "github.com/tenseleyFlow/shithub/internal/web" |
| 9 | ) |
| 10 | |
| 11 | var webCmd = &cobra.Command{ |
| 12 | Use: "web", |
| 13 | Short: "Run the shithub HTTP web server", |
| 14 | RunE: func(cmd *cobra.Command, args []string) error { |
| 15 | addr, _ := cmd.Flags().GetString("addr") |
| 16 | return web.Run(cmd.Context(), web.Options{Addr: addr}) |
| 17 | }, |
| 18 | } |
| 19 | |
| 20 | func init() { |
| 21 | webCmd.Flags().StringP("addr", "a", ":8080", "Address to bind the web server to") |
| 22 | } |
| 23 |