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.

30 lines
549 B

  1. package main
  2. import (
  3. "log"
  4. "os"
  5. "strconv"
  6. censusmanager "github.com/vocdoni/dvote-census/service"
  7. )
  8. func main() {
  9. if len(os.Args) < 2 {
  10. log.Fatal("Usage: " + os.Args[0] + " <port> [pubKey]")
  11. os.Exit(2)
  12. }
  13. port, err := strconv.Atoi(os.Args[1])
  14. if err != nil {
  15. log.Fatal(err)
  16. os.Exit(2)
  17. }
  18. pubK := ""
  19. if len(os.Args) > 2 {
  20. log.Print("Public key authentication enabled")
  21. pubK = os.Args[2]
  22. }
  23. log.Print("Starting process HTTP service on port " + os.Args[1])
  24. censusmanager.T.Init()
  25. censusmanager.Listen(port, "http", pubK)
  26. }