more refactor

This commit is contained in:
wt committed 2025-07-16 14:57:35 +07:00
1 parent 4fde79595e
commit c42a9cd0cf
5 files changed
+83 -48

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
package server
import (
"net/http"
"os"
)
func Run() {
if os.Getenv("ENABLE_TLS") == "true" {
http.ListenAndServeTLS(
os.Getenv("SERVER_ADDRESS")+":"+os.Getenv("SERVER_PORT"),
os.Getenv("CERT_FILE"),
os.Getenv("KEY_FILE"),
nil,
)
} else {
http.ListenAndServe(
os.Getenv("SERVER_ADDRESS")+":"+os.Getenv("SERVER_PORT"),
nil,
)
}
}