default route support
This commit is contained in:
parent
45e0cb4424
commit
6ff0805b1b
3
main.go
3
main.go
@ -183,6 +183,9 @@ func (this *App) ConfigRequestHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
func (this *App) StaticRequestHandler(w http.ResponseWriter, r *http.Request) {
|
func (this *App) StaticRequestHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
fileName := r.URL.Path[1:]
|
fileName := r.URL.Path[1:]
|
||||||
|
if fileName == "" {
|
||||||
|
fileName = "index.htm"
|
||||||
|
}
|
||||||
|
|
||||||
data, err := Asset(fileName)
|
data, err := Asset(fileName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user