Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Commit

Permalink
Use html/template for rendering html (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaskin committed Oct 16, 2017
1 parent 6027e95 commit d6e5226
Show file tree
Hide file tree
Showing 473 changed files with 6,474 additions and 5,056 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -18,7 +18,7 @@ deps:

.PHONY: generate
generate:
go generate
go generate ./...

.PHONY: test
test:
Expand Down
12 changes: 7 additions & 5 deletions bookbrowser.go
Expand Up @@ -9,6 +9,8 @@ import (
"strings"
"syscall"

"github.com/geek1011/BookBrowser/modules/server"

_ "github.com/geek1011/BookBrowser/formats/all"
"github.com/geek1011/BookBrowser/modules/sigusr"
"github.com/geek1011/BookBrowser/modules/util"
Expand Down Expand Up @@ -98,19 +100,19 @@ func main() {
}
}

server := NewServer(addr, bookdir, tempdir, true)
server.RefreshBookIndex()
s := server.NewServer(addr, bookdir, tempdir, curversion, true)
s.RefreshBookIndex()

if len(*server.Books) == 0 {
if len(*s.Books) == 0 {
log.Fatalln("Fatal error: no books found")
}

sigusr.Handle(func() {
log.Println("Booklist refresh triggered by SIGUSR1")
server.RefreshBookIndex()
s.RefreshBookIndex()
})

err = server.Serve()
err = s.Serve()
if err != nil {
log.Fatalf("Error starting server: %s\n", err)
}
Expand Down
175 changes: 0 additions & 175 deletions html.go

This file was deleted.

0 comments on commit d6e5226

Please sign in to comment.