| var config = configuration{} | var config = configuration{} | ||||
| func (m *configuration) readConfig() (e error) { | func (m *configuration) readConfig() (e error) { | ||||
| log.Printf("read Path config from %s\r\n", configFile) | |||||
| log.Printf("read Path config from %s", configFile) | |||||
| body, e := ioutil.ReadFile(configFile) | body, e := ioutil.ReadFile(configFile) | ||||
| if e != nil { | if e != nil { | ||||
| log.Fatal("Cannot read config from " + configFile) | log.Fatal("Cannot read config from " + configFile) |
| { | { | ||||
| "Host":"127.0.0.1", | |||||
| "Host":"localhost", | |||||
| "Port":"8080", | "Port":"8080", | ||||
| "DocRoot": "./html/", | "DocRoot": "./html/", | ||||
| "StaticUrl": "/", | "StaticUrl": "/", |
| import ( | import ( | ||||
| "biukop.com/sfm/loan" | "biukop.com/sfm/loan" | ||||
| "fmt" | "fmt" | ||||
| "log" | |||||
| log "github.com/sirupsen/logrus" | |||||
| "net/http" | "net/http" | ||||
| ) | ) | ||||
| http.HandleFunc("/spa/livecast", HelloHandler) | http.HandleFunc("/spa/livecast", HelloHandler) | ||||
| http.HandleFunc("/spa/editmeeting", HelloHandler) | http.HandleFunc("/spa/editmeeting", HelloHandler) | ||||
| fmt.Printf("Server started at port %s\n", config.Port) | |||||
| log.Printf("Server started at %s:%s\n", config.Host, config.Port) | |||||
| log.Fatal(http.ListenAndServe(config.Host+":"+config.Port, nil)) | log.Fatal(http.ListenAndServe(config.Host+":"+config.Port, nil)) | ||||
| } | } |