From eaeee320b356bde9d50b5e4dd7cdad9d26738c1e Mon Sep 17 00:00:00 2001 From: Axel Navarro Date: Mon, 26 Nov 2018 02:42:56 +0000 Subject: [PATCH] fix(docs): fix fetch users example on README (#7) --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index cb2f248..31f9070 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Heimdall -## Instalation +## Installation npm install @indec/heimdall @@ -15,7 +15,7 @@ AUTH_CLIENT_SECRET= GRANT_TYPE=client_credentials ``` -## Example +## Examples ### Login on client side @@ -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 @@ -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); +} ```