瀏覽代碼

Merge branch 'master' of https://github.com/lunny/tango

tags/v0.5.5
Lunny Xiao 2 年之前
父節點
當前提交
4a9fab6c56
簽署人: lunny <xiaolunwen@gmail.com> GPG 金鑰 ID: C3B7C91B632F738A
共有 1 個檔案被更改,包括 9 行新增2 行删除
  1. +9
    -2
      tan.go

+ 9
- 2
tan.go 查看文件

@@ -19,6 +19,7 @@ func Version() string {

// Tango describes tango object
type Tango struct {
http.Server
Router
handlers []Handler
logger Logger
@@ -146,7 +147,10 @@ func (t *Tango) Run(args ...interface{}) {
addr := getAddress(args...)
t.logger.Info("Listening on http://" + addr)

err := http.ListenAndServe(addr, t)
t.Server.Addr = addr
t.Server.Handler = t

err := t.ListenAndServe()
if err != nil {
t.logger.Error(err)
}
@@ -158,7 +162,10 @@ func (t *Tango) RunTLS(certFile, keyFile string, args ...interface{}) {

t.logger.Info("Listening on https://" + addr)

err := http.ListenAndServeTLS(addr, certFile, keyFile, t)
t.Server.Addr = addr
t.Server.Handler = t

err := t.ListenAndServeTLS(certFile, keyFile)
if err != nil {
t.logger.Error(err)
}


Loading…
取消
儲存