Skip to content

Instantly share code, notes, and snippets.

@volkovasystems
Created September 2, 2022 06:30
Show Gist options
  • Save volkovasystems/105c368f64e46f2631de2f98f128895f to your computer and use it in GitHub Desktop.
Save volkovasystems/105c368f64e46f2631de2f98f128895f to your computer and use it in GitHub Desktop.
app.use(
function( request, response, proceed ){
response
.header(
(
"Access-Control-Allow-Origin"
),
(
"*"
)
);
response
.header(
(
"Access-Control-Allow-Methods"
),
(
[
"PUT",
"GET",
"POST",
"DELETE",
"OPTIONS"
]
.join(
(
", "
)
)
)
);
response
.header(
(
"Access-Control-Allow-Credentials"
),
(
true
)
);
response
.header(
(
"Access-Control-Allow-Headers"
),
(
[
"Origin",
"X-Requested-With",
"Content-Type",
"Accept",
"View-Mode"
]
.join(
(
", "
)
)
)
);
proceed( );
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment