renderer added, storage + renderer interfaces renamed to Interface
This commit is contained in:
7
main.go
7
main.go
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/dalu/wiki/wiki/storage/mongo"
|
||||
"gopkg.in/mgo.v2"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"github.com/dalu/wiki/wiki/template"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -25,15 +26,17 @@ func main() {
|
||||
log.Fatal("initializeWiki: ", e.Error())
|
||||
}
|
||||
|
||||
renderer := template.New(true)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
wikiHandler := wiki.NewWikiHandler(mongostore, log)
|
||||
wikiHandler := wiki.NewWikiHandler(mongostore, renderer, log)
|
||||
mux.Handle(wiki.DefaultMountPath, http.StripPrefix(wiki.DefaultMountPath, wikiHandler))
|
||||
|
||||
log.Fatal(http.ListenAndServe(":8080", mux))
|
||||
}
|
||||
|
||||
func initializeWiki(s storage.WikiStorage) error {
|
||||
func initializeWiki(s storage.Interface) error {
|
||||
_, e := s.GetTermByName("")
|
||||
if e != nil {
|
||||
if e == mgo.ErrNotFound {
|
||||
|
Reference in New Issue
Block a user