Redirect index to /buckets
This commit is contained in:
parent
03e9afc888
commit
b822361b35
3 changed files with 8 additions and 2 deletions
|
@ -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")
|
||||
|
||||
|
|
1
main.go
1
main.go
|
@ -42,6 +42,7 @@ func main() {
|
|||
}
|
||||
|
||||
http.HandleFunc("/", indexHandler)
|
||||
http.HandleFunc("/buckets", bucketsHandler)
|
||||
http.HandleFunc("/buckets/", bucketHandler)
|
||||
|
||||
log.Fatal(http.ListenAndServe(":"+port, nil))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{ define "content" }}
|
||||
<table class="striped">
|
||||
<table>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in a new issue