Skip to content
Permalink
Browse files

Add Authorization schema. Fix some typos.

  • Loading branch information...
dunglas committed Aug 27, 2019
1 parent fdc313b commit fe731500ab6c19e9d58c38b3e289be7db4cf049d
Showing with 6 additions and 3 deletions.
  1. +5 −2 README.md
  2. +1 −1 examples/publisher-node.js
  3. BIN spec/authorization.png
@@ -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"`
@@ -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);
Binary file not shown.

0 comments on commit fe73150

Please sign in to comment.
You can’t perform that action at this time.