summaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-12-24 14:14:40 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-12-24 14:14:40 +0530
commit14ba16ec7abd66b4367db1dd1373ae9010de7d17 (patch)
tree00abbfa87647c00b8aa5d594ee210788bd6abd65 /server.go
parentc4867dad3256586d570f702d7afdf92fca6ab84a (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.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/server.go b/server.go
index 074abd9..d8b9c0d 100644
--- a/server.go
+++ b/server.go
@@ -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)