コード例 #1
0
ファイル: main.go プロジェクト: haijianren/martian
// configure installs a configuration handler at path.
func configure(path string, handler http.Handler) {
	if *allowCORS {
		handler = cors.NewHandler(handler)
	}

	http.Handle(filepath.Join(*api, path), handler)
}
コード例 #2
0
ファイル: main.go プロジェクト: eolexe/martian
// configure installs a configuration handler at path.
func configure(path string, handler http.Handler) {
	if *allowCORS {
		handler = cors.NewHandler(handler)
	}

	http.Handle(path, handler)
}