some UI work, editPOST handler
This commit is contained in:
18
main.go
18
main.go
@@ -5,10 +5,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/dalu/wiki/public"
|
||||
"github.com/dalu/wiki/storage"
|
||||
"github.com/dalu/wiki/storage/mongo"
|
||||
"github.com/dalu/wiki/template"
|
||||
"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"
|
||||
)
|
||||
@@ -33,11 +34,14 @@ func main() {
|
||||
wikiHandler := wiki.NewWikiHandler(mongostore, renderer, log)
|
||||
mux.Handle(wiki.DefaultMountPath, http.StripPrefix(wiki.DefaultMountPath, wikiHandler))
|
||||
|
||||
mux.Handle(public.CSSMountpoint, public.CSSHandler)
|
||||
mux.Handle(public.JSMountpoint, public.JSHandler)
|
||||
|
||||
server := &http.Server{
|
||||
Handler: mux,
|
||||
Addr: ":8080",
|
||||
Handler: mux,
|
||||
Addr: ":8080",
|
||||
WriteTimeout: 15 * time.Second,
|
||||
ReadTimeout: 15 * time.Second,
|
||||
ReadTimeout: 15 * time.Second,
|
||||
}
|
||||
|
||||
log.Fatal(server.ListenAndServe())
|
||||
@@ -61,7 +65,7 @@ func initializeWiki(s storage.Interface) error {
|
||||
r.PublishDate = time.Now()
|
||||
r.AuthorIP = "127.0.0.1"
|
||||
r.TermID = t2.ID.Hex()
|
||||
r.Text = "# Main Page"
|
||||
r.Text = "This is the main apge"
|
||||
t2.CurrentRevisionID = r.ID.Hex()
|
||||
if e := s.CreateTerm(t1); e != nil {
|
||||
return e
|
||||
|
Reference in New Issue
Block a user