cors

package module
v0.0.0-...-d76ff1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

cors

A Cors middleware for flygo

Usage

app := flygo.NewApp()
app.UseFilter(cors.New())
app.Get("/", func(c flygo.Context) {
    c.Text("index")
})
app.Run()

Config

  • Origin :Access-Control-Allow-Origin, default *
cors.Origin("http://domain.com")
  • Methods :Access-Control-Allow-Methods, default GET,POST,PUT,DELETE,PATCH
cors.Methods("GET", "POST")
  • Headers :Access-Control-Allow-Headers
cors.Headers("X-Requested-With")
  • Extra Headers
cors.ExtraHeaders(cors.Header("Access-Control-Max-Age", "86400"))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Header(name, value string) *header

func New

func New() *cors

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL