Showing content from https://github.com/rs/cors/raw/master/examples/martini/server.go below:
package main import ( "github.com/go-martini/martini" "github.com/martini-contrib/render" "github.com/rs/cors" ) func main() { c := cors.New(cors.Options{ AllowedOrigins: []string{"http://foo.com"}, }) m := martini.Classic() m.Use(render.Renderer()) m.Use(c.HandlerFunc) m.Get("/", func(r render.Render) { r.JSON(200, map[string]interface{}{"hello": "world"}) }) m.Run() }
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