kuvia2/vendor/github.com/flamego/cors
2022-01-15 00:09:03 +01:00
..
.gitignore Init 2022-01-15 00:09:03 +01:00
codecov.yml Init 2022-01-15 00:09:03 +01:00
cors.go Init 2022-01-15 00:09:03 +01:00
LICENSE Init 2022-01-15 00:09:03 +01:00
README.md Init 2022-01-15 00:09:03 +01:00

cors

GitHub Workflow Status Codecov GoDoc Sourcegraph

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

License

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