store arbitrary json blobs in postgres over http
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.

33 lines
607B

  1. package main
  2. import (
  3. "flag"
  4. "fmt"
  5. "github.com/kelseyhightower/envconfig"
  6. "log"
  7. "net/http"
  8. )
  9. var verbose = flag.Bool("verbose", false, "increase logging verbosity")
  10. func main() {
  11. flag.Parse()
  12. log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
  13. config := NewConfig()
  14. err := envconfig.Process("ITSLOG", config)
  15. if err != nil {
  16. log.Fatal(err)
  17. }
  18. if err := config.validate(); err != nil {
  19. log.Fatal(err)
  20. }
  21. log.Printf("%+v", config)
  22. http.Handle("/api/v0/info/", JsonHandler(apiInfo))
  23. err = http.ListenAndServe(fmt.Sprintf(":%d", config.Port), nil)
  24. if err != nil {
  25. log.Fatal(err)
  26. }
  27. }