|
|
@ -46,7 +46,6 @@ var defaultConfig = "./server.conf" |
|
|
|
|
|
|
|
|
|
|
|
var templates *template.Template |
|
|
|
var templates *template.Template |
|
|
|
var config *Config |
|
|
|
var config *Config |
|
|
|
var htmlApp string |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Helper to retrieve languages from request.
|
|
|
|
// Helper to retrieve languages from request.
|
|
|
|
func getRequestLanguages(r *http.Request, supported_languages []string) []string { |
|
|
|
func getRequestLanguages(r *http.Request, supported_languages []string) []string { |
|
|
@ -109,7 +108,7 @@ func handleRoomView(room string, w http.ResponseWriter, r *http.Request) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Prepare context to deliver to Javascript.
|
|
|
|
// Prepare context to deliver to Javascript.
|
|
|
|
context := &Context{Cfg: config, App: htmlApp, Host: r.Host, Ssl: ssl, Languages: langs} |
|
|
|
context := &Context{Cfg: config, App: "main", Host: r.Host, Ssl: ssl, Languages: langs} |
|
|
|
|
|
|
|
|
|
|
|
// Render the template.
|
|
|
|
// Render the template.
|
|
|
|
err := templates.ExecuteTemplate(w, "mainPage", &context) |
|
|
|
err := templates.ExecuteTemplate(w, "mainPage", &context) |
|
|
@ -133,12 +132,6 @@ func runner(runtime phoenix.Runtime) error { |
|
|
|
return fmt.Errorf("Configured root '%s' is not a directory.", rootFolder) |
|
|
|
return fmt.Errorf("Configured root '%s' is not a directory.", rootFolder) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
htmlApp = "main" |
|
|
|
|
|
|
|
if httputils.HasFilePath(path.Join(rootFolder, "static", "js", "main.min.js")) { |
|
|
|
|
|
|
|
runtime.Print("Using minimized javascript application.") |
|
|
|
|
|
|
|
htmlApp = "main.un" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !httputils.HasFilePath(path.Join(rootFolder, "static", "css", "main.min.css")) { |
|
|
|
if !httputils.HasFilePath(path.Join(rootFolder, "static", "css", "main.min.css")) { |
|
|
|
return fmt.Errorf("Unable to find client. Path correct and compiled css?") |
|
|
|
return fmt.Errorf("Unable to find client. Path correct and compiled css?") |
|
|
|
} |
|
|
|
} |
|
|
|