main.go 436 B

123456789101112131415161718192021222324
  1. package main
  2. import (
  3. "flag"
  4. "log"
  5. "github.com/kellegous/go/context"
  6. "github.com/kellegous/go/web"
  7. )
  8. func main() {
  9. flagData := flag.String("data", "data",
  10. "The location to use for the data store")
  11. flagAddr := flag.String("addr", ":8067",
  12. "The address that the HTTP server will bind")
  13. flag.Parse()
  14. ctx, err := context.Open(*flagData)
  15. if err != nil {
  16. log.Panic(err)
  17. }
  18. log.Panic(web.ListenAndServe(*flagAddr, ctx))
  19. }