diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-06-20 22:29:59 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-06-20 22:29:59 +0200 |
commit | 8f41ac456fc92a9ec333579498e9933d73404905 (patch) | |
tree | 6be8211c41c7ff19a6b23bd1d1d289a39bd6373e /lib/webserver/server.go | |
parent | dd62e1e5ec325c77164c578d11ba4c0e118307d9 (diff) |
Remove duplicate fields and set default SDK dir.
- Removed duplicate fields between Config and FileConfig
- set /xdt/sdk as default SDK directory
Diffstat (limited to 'lib/webserver/server.go')
-rw-r--r-- | lib/webserver/server.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/webserver/server.go b/lib/webserver/server.go index 4268b40..8fd7e44 100644 --- a/lib/webserver/server.go +++ b/lib/webserver/server.go @@ -100,12 +100,12 @@ func (s *Server) Serve() error { */ // Web Application (serve on / ) - idxFile := path.Join(s.cfg.WebAppDir, indexFilename) + idxFile := path.Join(s.cfg.FileConf.WebAppDir, indexFilename) if _, err := os.Stat(idxFile); err != nil { s.log.Fatalln("Web app directory not found, check/use webAppDir setting in config file: ", idxFile) } - s.log.Infof("Serve WEB app dir: %s", s.cfg.WebAppDir) - s.router.Use(static.Serve("/", static.LocalFile(s.cfg.WebAppDir, true))) + s.log.Infof("Serve WEB app dir: %s", s.cfg.FileConf.WebAppDir) + s.router.Use(static.Serve("/", static.LocalFile(s.cfg.FileConf.WebAppDir, true))) s.webApp = s.router.Group("/", s.serveIndexFile) { s.webApp.GET("/") @@ -114,8 +114,8 @@ func (s *Server) Serve() error { // Serve in the background serveError := make(chan error, 1) go func() { - fmt.Printf("Web Server running on localhost:%s ...\n", s.cfg.HTTPPort) - serveError <- http.ListenAndServe(":"+s.cfg.HTTPPort, s.router) + fmt.Printf("Web Server running on localhost:%s ...\n", s.cfg.FileConf.HTTPPort) + serveError <- http.ListenAndServe(":"+s.cfg.FileConf.HTTPPort, s.router) }() // Wait for stop, restart or error signals |