Skip to content

Commit

Permalink
Documentation for CORS option #82
Browse files Browse the repository at this point in the history
  • Loading branch information
electerious committed Feb 25, 2020
1 parent 2dc3af2 commit 6550286
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
16 changes: 13 additions & 3 deletions docs/CORS headers.md
Expand Up @@ -51,10 +51,20 @@ Access-Control-Allow-Headers: Content-Type

If you are running Ackee on a platform which handles SSL for you, you may want a quick solution for setting CORS headers instead of using a [reverse proxy](SSL%20and%20HTTPS.md).

As an environment variable, you will need to just set:
As an environment variable, you will need to set:

```bash
```
ACKEE_ALLOW_ORIGIN="https://example.com"
```

The proper header value for `Access-Control-Allow-Origin` will be set with the other headers being the recommended values.
The proper header value for `Access-Control-Allow-Origin` will be set with the other headers being the recommended values.

It's also possible to allow requests from all domains (not recommended) or from multiple domains:

```
ACKEE_ALLOW_ORIGIN="*"
```

```
ACKEE_ALLOW_ORIGIN="https://example.com,https://example2.com"
```
20 changes: 20 additions & 0 deletions docs/Options.md
Expand Up @@ -70,4 +70,24 @@ Set the environment to `development` to see additional details in the console an

```
NODE_ENV=development
```

## CORS headers

Quick solution for setting [CORS headers](CORS%20headers.md) instead of using a [reverse proxy](SSL%20and%20HTTPS.md). This is helpful if you are running Ackee on a platform which handles SSL for you.

```
ACKEE_ALLOW_ORIGIN="*"
```

*or*

```
ACKEE_ALLOW_ORIGIN="https://example.com"
```

*or*

```
ACKEE_ALLOW_ORIGIN="https://example.com,https://example2.com"
```

0 comments on commit 6550286

Please sign in to comment.