Example #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)
}
Example #2
0
File: jcr.go Project: 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
}