Esempio n. 1
0
func main() {
	fmt.Printf("Using config %s\n", conf.Path)
	fmt.Printf("Using models:\n")
	for _, m := range db.Models {
		t := reflect.TypeOf(m)
		fmt.Printf("    %s\n", fmt.Sprintf("%s", t)[1:])
	}

	template.Init(conf.Config.TemplatePaths)
	fmt.Printf(conf.Config.String())
	web.Config.StaticDir = conf.Config.StaticPath

	db.Connect(conf.Config.DbHostString(), conf.Config.DbName)
	db.RegisterAllIndexes()

	blog.AttachAdmin("/admin/")
	blog.Attach("/")

	app.AttachAdmin("/admin/")
	app.Attach("/")

	gallery.AttachAdmin("/admin/")
	gallery.Attach("/")

	web.Get("/$", blog.Index)
	web.Get("/(.*)", blog.Flatpage)

	app.AddPanel(&blog.PostPanel{})
	app.AddPanel(&blog.UnpublishedPanel{})
	app.AddPanel(&blog.PagesPanel{})
	app.AddPanel(&gallery.GalleryPanel{})

	web.Run(conf.Config.HostString())
}
Esempio n. 2
0
func main() {
	db.Connect(conf.Config.DbHostString(), conf.Config.DbName)

	updateTwitter()
}