more refactor
This commit is contained in:
1 parent
4fde79595e
commit
c42a9cd0cf
5 files changed
+83
-48
No files matched your search
@@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user