Redirect index to /buckets

This commit is contained in:
Lena Fuhrimann 2016-12-20 19:35:27 +01:00
parent 03e9afc888
commit b822361b35
3 changed files with 8 additions and 2 deletions

View file

@ -11,8 +11,13 @@ import (
minio "github.com/minio/minio-go"
)
// indexHandler handles the main page
// indexHandler forwards to "/buckets"
func indexHandler(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/buckets", http.StatusPermanentRedirect)
}
// bucketsHandler handles the main page
func bucketsHandler(w http.ResponseWriter, r *http.Request) {
lp := path.Join("templates", "layout.html")
ip := path.Join("templates", "index.html")

View file

@ -42,6 +42,7 @@ func main() {
}
http.HandleFunc("/", indexHandler)
http.HandleFunc("/buckets", bucketsHandler)
http.HandleFunc("/buckets/", bucketHandler)
log.Fatal(http.ListenAndServe(":"+port, nil))

View file

@ -1,5 +1,5 @@
{{ define "content" }}
<table class="striped">
<table>
<thead>
<tr>