pages-server/main.go

32 lines
513 B
Go
Raw Permalink Normal View History

package main
import (
"fmt"
"os"
_ "github.com/joho/godotenv/autoload"
2021-12-03 01:12:51 +00:00
"github.com/urfave/cli/v2"
2021-12-05 13:45:17 +00:00
2021-12-03 01:12:51 +00:00
"codeberg.org/codeberg/pages/cmd"
)
// can be changed with -X on compile
var version = "dev"
func main() {
2021-12-03 01:12:51 +00:00
app := cli.NewApp()
app.Name = "pages-server"
app.Version = version
app.Usage = "pages server"
app.Action = cmd.Serve
app.Flags = cmd.ServeFlags
app.Commands = []*cli.Command{
cmd.Certs,
2021-11-20 20:10:46 +00:00
}
2021-12-03 01:12:51 +00:00
if err := app.Run(os.Args); err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}