mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
Adapt the httprouter on cors adaptor example
Former-commit-id: 3abd819fc519faac55322d210a42c4d230bb46d5
This commit is contained in:
parent
74872c62c7
commit
d33371f393
|
@ -3,12 +3,15 @@ package main
|
||||||
import (
|
import (
|
||||||
"gopkg.in/kataras/iris.v6"
|
"gopkg.in/kataras/iris.v6"
|
||||||
"gopkg.in/kataras/iris.v6/adaptors/cors"
|
"gopkg.in/kataras/iris.v6/adaptors/cors"
|
||||||
|
"gopkg.in/kataras/iris.v6/adaptors/httprouter"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
app := iris.New()
|
app := iris.New()
|
||||||
app.Adapt(iris.DevLogger())
|
app.Adapt(iris.DevLogger())
|
||||||
|
app.Adapt(httprouter.New())
|
||||||
|
|
||||||
crs := cors.New(cors.Options{
|
crs := cors.New(cors.Options{
|
||||||
AllowedOrigins: []string{"*"},
|
AllowedOrigins: []string{"*"},
|
||||||
AllowCredentials: true,
|
AllowCredentials: true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user