arc-macro-cors
Enable CORS for Architect HTTP APIs (APIG HTTP Api only).
###Install:
npm i arc-macro-cors
And add to your .arc-file for default CORS settings:
@app
myapp
@cors
@http
get /
get /foo
post /foo
@macros
arc-macro-cors
Or configure specific CORS settings:
@app
myapp
@cors
allowOrigins https://example.com
allowMethods GET,POST,OPTIONS
allowHeaders Authorization,X-Custom-Header
exposeHeaders Content-Length,X-Custom-Header
maxAge 7200
allowCredentials true
@http
get /
get /foo
post /foo
@macros
arc-macro-cors
See AWS::Serverless::HttpApi/HttpApiCorsConfiguration for more information.