A simple page for all your links.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
615 B

  1. package main
  2. import (
  3. "github.com/abunchtell/publicbio"
  4. "github.com/urfave/cli/v2"
  5. )
  6. var (
  7. cmdServe = cli.Command{
  8. Name: "serve",
  9. Aliases: []string{"web"},
  10. Usage: "Run web application",
  11. Action: serveAction,
  12. Flags: []cli.Flag{
  13. &cli.StringFlag{
  14. Name: "host",
  15. Usage: "Site's base URL",
  16. },
  17. &cli.IntFlag{
  18. Name: "p",
  19. Value: 8080,
  20. Usage: "Port to start server on",
  21. },
  22. },
  23. }
  24. )
  25. func serveAction(c *cli.Context) error {
  26. cfg := &publicbio.Config{
  27. Host: c.String("host"),
  28. Port: c.Int("p"),
  29. UserFile: c.String("u"),
  30. }
  31. publicbio.Serve(cfg)
  32. return nil
  33. }