Skip to content

Commit

Permalink
Merge pull request #146 from dunglas/auth-schema
Browse files Browse the repository at this point in the history
Add Authorization schema. Fix some typos.
  • Loading branch information
dunglas committed Aug 28, 2019
2 parents fdc313b + fe73150 commit f9d28aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ const eventSource = new EventSource(url);
eventSource.onmessage = e => console.log(e); // do something with the payload
```

Optionaly, [the authorization mechanism](https://github.com/dunglas/mercure/blob/master/spec/mercure.md#authorization) can be used to subscribe to private updates.
Also optionaly, the hub URL can be automatically discovered:
Optionally, [the authorization mechanism](https://github.com/dunglas/mercure/blob/master/spec/mercure.md#authorization) can be used to subscribe to private updates.

![Authorization Schema](spec/authorization.png)

Also optionally, the hub URL can be automatically discovered:

```javascript
fetch('https://example.com/books/1') // Has this header `Link: <https://example.com/hub>; rel="mercure"`
Expand Down
2 changes: 1 addition & 1 deletion examples/publisher-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const req = http.request({
});

req.on('error', (e) => {
console.error(`An error occured: ${e.message}`);
console.error(`An error occurred: ${e.message}`);
});

req.write(postData);
Expand Down
Binary file added spec/authorization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f9d28aa

Please sign in to comment.