コード例 #1
0
ファイル: nocache_test.go プロジェクト: Centny/Cny4go
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
}