mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-07 21:44:55 +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
|
||||
tplFile, err := assets.ReadFile("content.html")
|
||||
if err != nil {
|
||||
cError.Println("Failed generating HTML template")
|
||||
return
|
||||
}
|
||||
|
||||
tplCache, err = template.New("content.html").Parse(string(tplFile))
|
||||
tplFile, _ := assets.ReadFile("cache.html")
|
||||
tplCache, err = template.New("cache.html").Parse(string(tplFile))
|
||||
if err != nil {
|
||||
cError.Println("Failed generating HTML template")
|
||||
return
|
||||
|
@ -118,18 +113,14 @@ func serveIndexPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params
|
|||
return
|
||||
}
|
||||
|
||||
asset, err := assets.ReadFile("index.html")
|
||||
checkError(err)
|
||||
|
||||
asset, _ := assets.ReadFile("index.html")
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
buffer := bytes.NewBuffer(asset)
|
||||
io.Copy(w, buffer)
|
||||
}
|
||||
|
||||
func serveLoginPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
asset, err := assets.ReadFile("login.html")
|
||||
checkError(err)
|
||||
|
||||
asset, _ := assets.ReadFile("login.html")
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
buffer := bytes.NewBuffer(asset)
|
||||
io.Copy(w, buffer)
|
||||
|
|
Loading…
Add table
Reference in a new issue