worked on handler and templates

This commit is contained in:
2017-02-11 23:13:16 +01:00
parent 00a88254b0
commit ebe1360dc0
8 changed files with 72 additions and 29 deletions

11
main.go
View File

@@ -8,9 +8,9 @@ import (
"github.com/dalu/wiki/wiki"
"github.com/dalu/wiki/wiki/storage"
"github.com/dalu/wiki/wiki/storage/mongo"
"github.com/dalu/wiki/wiki/template"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/dalu/wiki/wiki/template"
)
func main() {
@@ -33,7 +33,14 @@ func main() {
wikiHandler := wiki.NewWikiHandler(mongostore, renderer, log)
mux.Handle(wiki.DefaultMountPath, http.StripPrefix(wiki.DefaultMountPath, wikiHandler))
log.Fatal(http.ListenAndServe(":8080", mux))
server := &http.Server{
Handler: mux,
Addr: ":8080",
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}
log.Fatal(server.ListenAndServe())
}
func initializeWiki(s storage.Interface) error {