Redirect / to index.html

This commit is contained in:
Jakob Borg 2014-01-06 00:05:07 +01:00
parent 8c1996f7e5
commit 0ceddc4fa3

5
gui.go
View File

@ -15,6 +15,7 @@ import (
func startGUI(addr string, m *Model) { func startGUI(addr string, m *Model) {
router := martini.NewRouter() router := martini.NewRouter()
router.Get("/", getRoot)
router.Get("/rest/version", restGetVersion) router.Get("/rest/version", restGetVersion)
router.Get("/rest/model", restGetModel) router.Get("/rest/model", restGetModel)
router.Get("/rest/connections", restGetConnections) router.Get("/rest/connections", restGetConnections)
@ -31,6 +32,10 @@ func startGUI(addr string, m *Model) {
}() }()
} }
func getRoot(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/index.html", 302)
}
func restGetVersion() string { func restGetVersion() string {
return Version return Version
} }