mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
updated templates, added CORS support and docs
This commit is contained in:
parent
8dde4c7e22
commit
77582bd341
42
docs/providers/spotinst/guide/cors.md
Normal file
42
docs/providers/spotinst/guide/cors.md
Normal file
@ -0,0 +1,42 @@
|
||||
<!--
|
||||
title: Serverless Framework - Spotinst Functions Guide - Credentials
|
||||
menuText: Credentials
|
||||
menuOrder: 4
|
||||
description: How to set up the Serverless Framework with your Spotinst Functions credentials
|
||||
layout: Doc
|
||||
-->
|
||||
|
||||
<!-- DOCS-SITE-LINK:START automatically generated -->
|
||||
### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/spotinst/guide/cors)
|
||||
<!-- DOCS-SITE-LINK:END -->
|
||||
|
||||
# Spotinst Functions - CORS
|
||||
|
||||
You can enable CORS for cross-domain HTTP requests with Spotinst Functions. Add the required fields to you serverless.yml file.
|
||||
|
||||
Example CORS object:
|
||||
```yaml
|
||||
cors:
|
||||
- enabled: true
|
||||
origin: "http://foo.example"
|
||||
headers: "Content-Type,X-PINGOTHER"
|
||||
methods: "PUT,POST"
|
||||
```
|
||||
|
||||
Parameters:
|
||||
- enabled: Boolean
|
||||
- Specify if CORS is enabled for the function.
|
||||
- default: false
|
||||
- origin: String
|
||||
- Specifies a domain/origin that may access the resource. A wildcard '*' may be used to allow any origin to access the resource.
|
||||
- default: '*'
|
||||
- methods: String
|
||||
- Comma-separated list of HTTP methods that are allowed to access the resource. This is used in response to a preflight request.
|
||||
- default: 'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'
|
||||
- headers: String
|
||||
- Comma-separated list of allowed headers.
|
||||
- default: 'Content-Type,Authorization'
|
||||
|
||||
|
||||
|
||||
|
||||
@ -27,8 +27,13 @@ functions:
|
||||
timeout: 30
|
||||
access: private
|
||||
# activeVersions:
|
||||
# - "version": "$LATEST"
|
||||
# - "version": "$LATEST"
|
||||
# "percentage": 100.0
|
||||
# cors:
|
||||
# enabled: # false by default
|
||||
# origin: # '*' by default
|
||||
# headers: # 'Content-Type,Authorization' by default
|
||||
# methods: # 'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT' by default
|
||||
# cron: # Setup scheduled trigger with cron expression
|
||||
# active: true
|
||||
# value: '* * * * *'
|
||||
|
||||
@ -29,6 +29,11 @@ functions:
|
||||
# activeVersions:
|
||||
# - "version": "$LATEST"
|
||||
# "percentage": 100.0
|
||||
# cors:
|
||||
# enabled: # false by default
|
||||
# origin: # '*' by default
|
||||
# headers: # 'Content-Type,Authorization' by default
|
||||
# methods: # 'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT' by default
|
||||
# cron: # Setup scheduled trigger with cron expression
|
||||
# active: true
|
||||
# value: '* * * * *'
|
||||
|
||||
@ -28,7 +28,12 @@ functions:
|
||||
access: private
|
||||
# activeVersions:
|
||||
# - "version": "$LATEST"
|
||||
# "percentage": 100.0
|
||||
# "percentage": 100.0
|
||||
# cors:
|
||||
# enabled: # false by default
|
||||
# origin: # '*' by default
|
||||
# headers: # 'Content-Type,Authorization' by default
|
||||
# methods: # 'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT' by default
|
||||
# cron: # Setup scheduled trigger with cron expression
|
||||
# active: true
|
||||
# value: '* * * * *'
|
||||
|
||||
@ -29,6 +29,11 @@ functions:
|
||||
# activeVersions:
|
||||
# - "version": "$LATEST"
|
||||
# "percentage": 100.0
|
||||
# cors:
|
||||
# enabled: # false by default
|
||||
# origin: # '*' by default
|
||||
# headers: # 'Content-Type,Authorization' by default
|
||||
# methods: # 'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT' by default
|
||||
# cron: # Setup scheduled trigger with cron expression
|
||||
# active: true
|
||||
# value: '* * * * *'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user