Commit 4f28e47f authored by Andreas Wagner's avatar Andreas Wagner
Browse files

Prepare a bit for SSL..

parent 90802049
......@@ -5,6 +5,7 @@ import (
"strconv"
// "github.com/davecgh/go-spew/spew"
"github.com/sirupsen/logrus"
"gitlab.gwdg.de/rg-mpg-de/tei2zenodo"
"gitlab.gwdg.de/rg-mpg-de/tei2zenodo/internal/pkg/conf"
......@@ -32,10 +33,34 @@ func main() {
log.Printf("Starting tei2zenodo daemon")
// log.Printf("[main/main] Config: %+v", Config)
// spew.Dump(Config)
// Get routes
router := routing.SetupRoutes(Config)
router.Run(":" + strconv.FormatInt(Config.ListenSpec, 10))
/*
// Get server specs
url, HNErr := os.Hostname()
if HNErr != nil {
panic(fmt.Errorf("Could not find hostname: %+v", HNErr))
}
port := strconv.Itoa(int(Config.ListenSpec))
address := url
if len(port) > 0 {
address = address + ":" + port
}
// Build server struct
srv := &http.Server{
Addr: address,
Handler: router,
}
err := autotls.Run(router, url)
if err != nil && err != http.ErrServerClosed {
fmt.Errorf("listen: %s", err)
}
*/
log.Fatal(router.Run(":" + strconv.FormatInt(Config.ListenSpec, 10)))
// router.RunTLS(":"+strconv.Itoa(Config.ListenSpec), "./policey_server.cert", "./policey_server.key")
// log.Fatal(autotls.Run(router, os.Hostname()))
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment