mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-11 23:45:51 +08:00
Minor clean up
This commit is contained in:
parent
ac75f8cff5
commit
69e2754aa3
2 changed files with 4 additions and 13 deletions
17
cmd/serve.go
17
cmd/serve.go
|
@ -40,13 +40,8 @@ var (
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare template
|
// Prepare template
|
||||||
tplFile, err := assets.ReadFile("content.html")
|
tplFile, _ := assets.ReadFile("cache.html")
|
||||||
if err != nil {
|
tplCache, err = template.New("cache.html").Parse(string(tplFile))
|
||||||
cError.Println("Failed generating HTML template")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
tplCache, err = template.New("content.html").Parse(string(tplFile))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cError.Println("Failed generating HTML template")
|
cError.Println("Failed generating HTML template")
|
||||||
return
|
return
|
||||||
|
@ -118,18 +113,14 @@ func serveIndexPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
asset, err := assets.ReadFile("index.html")
|
asset, _ := assets.ReadFile("index.html")
|
||||||
checkError(err)
|
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html")
|
w.Header().Set("Content-Type", "text/html")
|
||||||
buffer := bytes.NewBuffer(asset)
|
buffer := bytes.NewBuffer(asset)
|
||||||
io.Copy(w, buffer)
|
io.Copy(w, buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
func serveLoginPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
func serveLoginPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
asset, err := assets.ReadFile("login.html")
|
asset, _ := assets.ReadFile("login.html")
|
||||||
checkError(err)
|
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html")
|
w.Header().Set("Content-Type", "text/html")
|
||||||
buffer := bytes.NewBuffer(asset)
|
buffer := bytes.NewBuffer(asset)
|
||||||
io.Copy(w, buffer)
|
io.Copy(w, buffer)
|
||||||
|
|
Loading…
Add table
Reference in a new issue