示例#1
0
func main() {
	mux := webc.NewMux("CTIXID", (webc.HOUR / 2))

	// db managment
	mux.Get("/test", Test)
	mux.Get("/", Root)
	mux.Post("/connection", AddConnection)
	mux.Post("/connection/save", SaveConnection)
	mux.Post("/connection/:db/del", DelConnection)

	mux.Get("/connect/:db", Connect)
	mux.Get("/disconnect", Disconnect)

	mux.Get("/export", ExportDB)
	mux.Post("/import", ImportDB)
	mux.Post("/erase", EraseDB)

	// store managment
	mux.Post("/new", SaveStore)
	mux.Get("/:store", Store)
	mux.Post("/:store", DelStore)

	// store search
	mux.Post("/:store/search/save", SaveSearch)

	// record managment
	mux.Get("/:store/new", NewRecord)
	mux.Post("/:store/add", AddRecord)
	mux.Post("/:store/import", UploadRecords)
	mux.Get("/:store/:record", Record)
	mux.Post("/:store/:record", SaveRecord)
	mux.Post("/:store/:record/del", DelRecord)

	mux.Serve(":8080")
}
示例#2
0
func main() {
	//defer profile.Start(profile.CPUProfile).Stop()
	mux := webc.NewMux("CTXID", (webc.HOUR / 2))
	mux.Get("/", homeController)
	mux.Get("/admin", admin)
	mux.Get("/admin/login", adminLogin)
	mux.Get("/admin/add", adminAdd)
	mux.Get("/admin/:id", adminId)
	mux.Get("/reload", reloadTemplates)
	mux.Get("/:slug", landing)
	mux.Get("/login/:slug", multiLogin)
	mux.Get("/logout/:slug", logout)
	mux.Get("/protected/:slug", protected)
	fmt.Println("running...")
	mux.Serve(":8080")
}