Skip to content

Commit

Permalink
fix(docs): fix fetch users example on README (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
navarroaxel authored Nov 26, 2018
1 parent 23e7821 commit eaeee32
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Heimdall

## Instalation
## Installation

npm install @indec/heimdall

Expand All @@ -15,7 +15,7 @@ AUTH_CLIENT_SECRET=<your app secret>
GRANT_TYPE=client_credentials
```

## Example
## Examples

### Login on client side

Expand All @@ -24,7 +24,7 @@ import {LoginService} from '@indec/heimdall/client';

// ENDPOINT constant is your heimdall server. i.e: http://localhost:5000
const loginService = new LoginService(ENDPOINT);
const token = await loginService.login(username, password)
const token = await loginService.login(username, password);
```

### Clean user session
Expand All @@ -41,9 +41,11 @@ List your app's users on server side:

```js
const {UserService} = require('@indec/heimdall').services;
UserService.fetchAll.then(
users => console.log(users)
).catch(
err => console.error(err)
)

try {
const users = await UserService.fetchAll();
console.log(users);
} catch (err) {
console.error(err);
}
```

0 comments on commit eaeee32

Please sign in to comment.