Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 4881206

Browse files
committedDec 18, 2015
docs: Update CORS handling docs.
Closes #156
1 parent ecccc92 commit 4881206

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ When using the api from script tag for things that require buffers (`ipfs.add`,
5555

5656
## CORS
5757

58-
If are using this module in a browser with something like browserify, then you will get an error saying that the origin is not allowed. This would be a CORS ("Cross Origin Resource Sharing") failure. The ipfs server rejects requests from unknown domains by default. You can whitelist the domain that you are calling from by exporting `API_ORIGIN` and restarting the daemon, like:
58+
If are using this module in a browser with something like browserify, then you will get an error saying that the origin is not allowed. This would be a CORS ("Cross Origin Resource Sharing") failure. The ipfs server rejects requests from unknown domains by default. You can whitelist the domain that you are calling from by changing your ipfs config like this:
5959

6060
```bash
61-
export API_ORIGIN="http://localhost:8080"
62-
ipfs daemon
61+
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\"http://example.com\"]"
6362
```
6463

6564
## API

0 commit comments

Comments
 (0)
This repository has been archived.