kopia lustrzana https://github.com/cyoung/stratux
Roll back webserver, use Go as webserver.
rodzic
bcf7bbb053
commit
1308e74587
|
@ -39,7 +39,7 @@ import (
|
|||
const (
|
||||
configLocation = "/etc/stratux.conf"
|
||||
indexFilename = "/var/log/stratux/LOGINDEX"
|
||||
managementAddr = ":8080"
|
||||
managementAddr = ":80"
|
||||
debugLog = "/var/log/stratux.log"
|
||||
maxDatagramSize = 8192
|
||||
maxUserMsgQueueSize = 25000 // About 10MB per port per connected client.
|
||||
|
|
|
@ -304,10 +304,19 @@ func setJSONHeaders(w http.ResponseWriter) {
|
|||
w.Header().Set("Content-Type", "application/json")
|
||||
}
|
||||
|
||||
func defaultServer(w http.ResponseWriter, r *http.Request) {
|
||||
// setNoCache(w)
|
||||
|
||||
http.FileServer(http.Dir("/var/www")).ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
func managementInterface() {
|
||||
weatherUpdate = NewUIBroadcaster()
|
||||
trafficUpdate = NewUIBroadcaster()
|
||||
|
||||
http.HandleFunc("/", defaultServer)
|
||||
http.Handle("/logs/", http.StripPrefix("/logs/", http.FileServer(http.Dir("/var/log"))))
|
||||
|
||||
http.HandleFunc("/status",
|
||||
func(w http.ResponseWriter, req *http.Request) {
|
||||
s := websocket.Server{
|
||||
|
|
Ładowanie…
Reference in New Issue