示例#1
0
func TestNoCache(t *testing.T) {
	mux := routing.NewSessionMux2("")
	mux.HFilterFunc("^.*$", NoCacheFilter)
	mux.HFunc("^.*$", func(hs *routing.HTTPSession) routing.HResult {
		return routing.HRES_RETURN
	})
	ts := httptest.NewServer(mux)
	util.HGet("%v", ts.URL)
}
示例#2
0
文件: jcr.go 项目: Centny/Cny4go
func NewJcrMux() *routing.SessionMux {
	mux := routing.NewSessionMux2("/jcr")
	cors := filter.NewCORS()
	cors.AddSite("*")
	mux.HFilter("^/(conf|store|jcr)(\\?.*)?$", cors)
	mux.HFunc("^/conf(\\?.*)?$", JcrConf)
	mux.HFunc("^/store(\\?.*)?$", JcrStore)
	mux.HFunc("^/jcr\\.js(\\?.*)?$", JcrJs)
	mux.HFunc("^/exit(\\?.*)?$", JcrExit)
	return mux
}