cors

GitHub Workflow Status Codecov GoDoc Sourcegraph

Package cors is a middleware that provides the Cross-Origin Resource Sharing for Flamego.

Getting started

  1. package main
  2. import (
  3. "github.com/flamego/cors"
  4. "github.com/flamego/flamego"
  5. )
  6. func main() {
  7. f := flamego.Classic()
  8. f.Use(cors.CORS())
  9. f.Get("/", func(c flamego.Context) string {
  10. return "ok"
  11. })
  12. f.Run()
  13. }

Installation

The minimum requirement of Go is 1.16.

  1. go get github.com/flamego/cors

Getting help

License

This project is under the MIT License. See the LICENSE file for the full license text.