my fork of the bluesky client
at main 60 lines 1.2 kB view raw
1package main 2 3import ( 4 "os" 5 6 _ "github.com/joho/godotenv/autoload" 7 8 logging "github.com/ipfs/go-log" 9 "github.com/urfave/cli/v2" 10) 11 12var log = logging.Logger("embedr") 13 14func init() { 15 logging.SetAllLoggers(logging.LevelDebug) 16 //logging.SetAllLoggers(logging.LevelWarn) 17} 18 19func main() { 20 run(os.Args) 21} 22 23func run(args []string) { 24 25 app := cli.App{ 26 Name: "embedr", 27 Usage: "web server for embed.bsky.app post embeds", 28 } 29 30 app.Commands = []*cli.Command{ 31 &cli.Command{ 32 Name: "serve", 33 Usage: "run the server", 34 Action: serve, 35 Flags: []cli.Flag{ 36 &cli.StringFlag{ 37 Name: "appview-host", 38 Usage: "method, hostname, and port of PDS instance", 39 Value: "https://public.api.bsky.app", 40 EnvVars: []string{"ATP_APPVIEW_HOST"}, 41 }, 42 &cli.StringFlag{ 43 Name: "http-address", 44 Usage: "Specify the local IP/port to bind to", 45 Required: false, 46 Value: ":8100", 47 EnvVars: []string{"HTTP_ADDRESS"}, 48 }, 49 &cli.BoolFlag{ 50 Name: "debug", 51 Usage: "Enable debug mode", 52 Value: false, 53 Required: false, 54 EnvVars: []string{"DEBUG"}, 55 }, 56 }, 57 }, 58 } 59 app.RunAndExitOnError() 60}