mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 20:41:57 +00:00
Modification
- Add configurator for Party - Modification for CORS middleware example Former-commit-id: f01c01d4eac41666a92890461851909a6ade018b
This commit is contained in:
@@ -13,14 +13,14 @@ import (
|
||||
func main() {
|
||||
|
||||
app := iris.New()
|
||||
crs := cors.New(cors.Options{
|
||||
crs := cors.NewPartyMiddleware(cors.Options{
|
||||
AllowedOrigins: []string{"*"}, // allows everything, use that to change the hosts.
|
||||
AllowedMethods: router.AllMethods[:],
|
||||
AllowCredentials: true,
|
||||
})
|
||||
|
||||
v1 := app.Party("/api/v1")
|
||||
v1.Use(crs)
|
||||
v1.ConfigureParty(crs)
|
||||
{
|
||||
v1.Get("/home", func(ctx iris.Context) {
|
||||
ctx.WriteString("Hello from /home")
|
||||
|
||||
Reference in New Issue
Block a user