arc-macro-cors

2.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i arc-macro-cors

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

2.71 kB

Total Files

3

Last publish

Collaborators

  • thedersen