1.4 KiB
1.4 KiB
cors
Package cors is a middleware that provides the Cross-Origin Resource Sharing for Flamego.
Getting started
package main
import (
"github.com/flamego/cors"
"github.com/flamego/flamego"
)
func main() {
f := flamego.Classic()
f.Use(cors.CORS())
f.Get("/", func(c flamego.Context) string {
return "ok"
})
f.Run()
}
Installation
The minimum requirement of Go is 1.16.
go get github.com/flamego/cors
Getting help
- Please file an issue or start a discussion on the flamego/flamego repository.
License
This project is under the MIT License. See the LICENSE file for the full license text.