Showing content from https://github.com/rs/cors/raw/master/examples/alice/server.go below:
package main import ( "net/http" "github.com/justinas/alice" "github.com/rs/cors" ) func main() { c := cors.New(cors.Options{ AllowedOrigins: []string{"http://foo.com"}, }) mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") w.Write([]byte("{\"hello\": \"world\"}")) }) chain := alice.New(c.Handler).Then(mux) http.ListenAndServe(":8080", chain) }
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4