update readme.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-10-19 20:51:59 +08:00
parent 34ed289f26
commit e33494abc7

View File

@ -1,9 +1,17 @@
# CORS gin's middleware # CORS gin's middleware
[![Build Status](https://travis-ci.org/gin-contrib/cors.svg)](https://travis-ci.org/gin-contrib/cors)
[![codecov](https://codecov.io/gh/gin-contrib/cors/branch/master/graph/badge.svg)](https://codecov.io/gh/gin-contrib/cors)
[![Go Report Card](https://goreportcard.com/badge/github.com/gin-contrib/cors)](https://goreportcard.com/report/github.com/gin-contrib/cors)
[![GoDoc](https://godoc.org/github.com/gin-contrib/cors?status.svg)](https://godoc.org/github.com/gin-contrib/cors)
[![Join the chat at https://gitter.im/gin-gonic/gin](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gin-gonic/gin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Gin middleware/handler to enable CORS support. Gin middleware/handler to enable CORS support.
## Usage ## Usage
###Canonical example: ### Canonical example:
```go ```go
package main package main
@ -37,7 +45,7 @@ func main() {
} }
``` ```
###Using DefaultConfig as start point ### Using DefaultConfig as start point
```go ```go
func main() { func main() {
@ -56,7 +64,7 @@ func main() {
} }
``` ```
###Default() allows all origins ### Default() allows all origins
```go ```go
func main() { func main() {
@ -69,6 +77,3 @@ func main() {
router.Run() router.Run()
} }
``` ```