Browse Source

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

tags/v0.5.5
Lunny Xiao 1 year ago
parent
commit
4a9fab6c56
Signed by: lunny <xiaolunwen@gmail.com> GPG Key ID: C3B7C91B632F738A
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      tan.go

+ 9
- 2
tan.go View File

@@ -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…
Cancel
Save