From f6971041b05606445e99d070bf9e60eba9875962 Mon Sep 17 00:00:00 2001 From: kyledinh Date: Mon, 7 Jul 2014 18:29:38 -0700 Subject: [PATCH] RunTLS() for http.ListenAndServeTLS run the engine for https Fixes PR #52 --- gin.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gin.go b/gin.go index a06c13a5..1c4b019f 100644 --- a/gin.go +++ b/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 *********/ /************************************/