Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jhsc/gin-cors

CORS middleware for Gin
https://github.com/jhsc/gin-cors

gin gin-middleware golang

Last synced: about 1 month ago
JSON representation

CORS middleware for Gin

Awesome Lists containing this project

README

        

# gin-cors

CORS middleware for Gin.

## Installation
Download and install:
```sh
$ go get github.com/jhsc/gin-cors
```

Import it in your code:

```go
import "github.com/jhsc/gin-cors"
```

### Example:
```go
import (
"github.com/gin-gonic/gin"
"github.com/jhsc/gin-cors"
)

func main(){
g := gin.New()
g.Use(cors.Middleware(cors.Options{
AllowOrigins: []string{"http://test.com"},
}))
}
```