debug needed
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
package webserver
|
||||
|
||||
import "github.com/sirupsen/logrus"
|
||||
|
||||
func init() {
|
||||
logrus.Info("web server loaded")
|
||||
}
|
@@ -12,15 +12,18 @@ type Server struct {
|
||||
rtcConnector *webrtcconnection.Connection
|
||||
}
|
||||
|
||||
var DefaultServer *Server
|
||||
func NewServer(o *Options) (*Server, error) {
|
||||
rtc, err := webrtcconnection.New(o.WebRTC)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func NewServer(o *Options) *Server {
|
||||
s := &Server{
|
||||
options: o,
|
||||
webServer: gin.New(),
|
||||
rtcConnector: webrtcconnection.New(o.WebRTC),
|
||||
rtcConnector: rtc,
|
||||
}
|
||||
return s
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func (s *Server) Run() error {
|
||||
@@ -29,12 +32,3 @@ func (s *Server) Run() error {
|
||||
s.setupRoute()
|
||||
return s.webServer.Run(s.options.Listen)
|
||||
}
|
||||
|
||||
func Setup(o *Options) {
|
||||
DefaultServer = NewServer(o)
|
||||
go func() {
|
||||
if err := DefaultServer.Run(); err != nil {
|
||||
logrus.Fatal("cannot run webserver with error: ", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
@@ -26,8 +26,6 @@ func staticFileHandler() gin.HandlerFunc {
|
||||
defer ctx.Abort()
|
||||
filename := strings.TrimLeft(ctx.Request.RequestURI, "/")
|
||||
|
||||
logrus.Debug("static file: ", filename)
|
||||
|
||||
if filename == "" {
|
||||
filename = "index.html"
|
||||
}
|
||||
|
Reference in New Issue
Block a user