Browse Source

RunTLS() for http.ListenAndServeTLS

run the engine for https

Fixes PR #52
kyledinh 11 years ago
parent
commit
f6971041b0
1 changed files with 6 additions and 0 deletions
  1. 6 0
      gin.go

+ 6 - 0
gin.go

@@ -171,6 +171,12 @@ func (engine *Engine) Run(addr string) {
 	}
 }
 
+func (engine *Engine) RunTLS(addr string, cert string, key string) {
+	if err := http.ListenAndServeTLS(addr, cert, key, engine); err != nil {
+		panic(err)
+	}
+}
+
 /************************************/
 /********** ROUTES GROUPING *********/
 /************************************/