ministream/main.go

40 lines
660 B
Go

package main
import (
"context"
"fmt"
"os"
"git.t-juice.club/torjus/ministream/server"
"github.com/urfave/cli/v2"
)
const Version = "v0.1.1"
func main() {
app := cli.App{
Name: "ministream",
Usage: "Small livestreaming platform.",
Commands: []*cli.Command{
{
Name: "serve",
Usage: "Start livestreaming server.",
Action: func(ctx *cli.Context) error {
store := server.NewUserStore()
srv := server.NewServer(store)
srv.Addr = ":8080"
srv.ListenAndServe()
return nil
},
},
},
Version: Version,
}
err := app.RunContext(context.Background(), os.Args)
if err != nil {
fmt.Println(err)
}
}