Categorygithub.com/go-http-utils/cors
repositorypackage
0.0.0-20170207144901-58c2accd8747
Repository: https://github.com/go-http-utils/cors.git
Documentation: pkg.go.dev

# README

cors

Build Status Coverage Status

CORS middleware for Go.

Installation

go get -u github.com/go-http-utils/cors

Documentation

API documentation can be found here: https://godoc.org/github.com/go-http-utils/cors

Usage

import (
  "github.com/go-http-utils/cors"
)
mux := http.NewServeMux()
mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
  res.Write([]byte("Hello World"))
})

http.ListenAndServe(":8080", cors.Handler(mux))