mirror of
https://github.com/samsonjs/retrogit.git
synced 2026-03-25 09:25:49 +00:00
19 lines
392 B
Go
19 lines
392 B
Go
package githop
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
)
|
|
|
|
func init() {
|
|
http.HandleFunc("/", index)
|
|
}
|
|
|
|
var indexTemplate = template.Must(template.ParseFiles("templates/index.html"))
|
|
|
|
func index(w http.ResponseWriter, r *http.Request) {
|
|
tc := make(map[string]interface{})
|
|
if err := indexTemplate.Execute(w, tc); err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
}
|
|
}
|