Add option to change title
This commit is contained in:
parent
f125272722
commit
5195350174
4 changed files with 6 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"port": 4000,
|
||||
"allowed_hosts": "http://localhost:4000"
|
||||
"allowed_hosts": "http://localhost:4000",
|
||||
"title": "GoDash"
|
||||
}
|
|
@ -6,7 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func (server *Server) setupRouter() {
|
||||
server.Router.Get("/", goDash)
|
||||
server.Router.Get("/", server.goDash)
|
||||
server.Router.Get("/ws", webSocket)
|
||||
|
||||
server.serveStatic("static")
|
||||
|
|
|
@ -19,10 +19,10 @@ type launchpadInformation struct {
|
|||
System system.System
|
||||
}
|
||||
|
||||
func goDash(w http.ResponseWriter, r *http.Request) {
|
||||
func (server *Server) goDash(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
files.ParseAndServeHtml(w, "index.gohtml", launchpadInformation{
|
||||
Title: "GoDash",
|
||||
Title: server.Title,
|
||||
Bookmarks: bookmark.Bookmarks,
|
||||
Weather: weather.CurrentWeather,
|
||||
System: system.Sys,
|
||||
|
|
|
@ -10,5 +10,5 @@ type Server struct {
|
|||
Hub *hub.Hub
|
||||
Port int
|
||||
AllowedHosts []string `mapstructure:"ALLOWED_HOSTS"`
|
||||
Swagger bool
|
||||
Title string
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue