diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2023-12-24 14:14:40 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2023-12-24 14:14:40 +0530 |
commit | 14ba16ec7abd66b4367db1dd1373ae9010de7d17 (patch) | |
tree | 00abbfa87647c00b8aa5d594ee210788bd6abd65 /server.go | |
parent | c4867dad3256586d570f702d7afdf92fca6ab84a (diff) |
server.go & README.md : use certpath and keypath in .env, Updating README with Installation and Usage steps
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -34,9 +34,6 @@ func main() { api_endpoint_url = defaultAPIEndpointURL } - certPath := "/etc/letsencrypt/live/" + domain + "/fullchain.pem" - keyPath := "/etc/letsencrypt/live/" + domain + "/privkey.pem" - e := echo.New() e.POST("/upload", handlers.AddHash) e.POST("/verify", handlers.VerifyHash) @@ -46,6 +43,8 @@ func main() { case "development": e.Logger.Fatal(e.Start(":" + port)) case "production": + certPath := os.Getenv("CERTPATH") + keyPath := os.Getenv("KEYPATH") e.Logger.Fatal(e.StartTLS(":"+port, certPath, keyPath)) default: log.Printf("Unknown environment '%s', starting on default port %s\n", environment, port) |