restauth

1.1.1 • Public • Published

RestAuth

A Rest client supporting authentication with JSON Web Token and cookies. Useful for testing authenticated REST API.

NPM version Dependency Status

Install

$ npm install --save restauth

Usage

 
import {Client} from 'restauth';
 
let config = {
  username:"alice",
  password:"password",
  url:"http://localhost:3000/api/"
};
 
let client = new Client(config);
let resLogin = await client.login();
assert(resLogin);
let me = await client.get('v1/me');
assert(me);
 

Test

$ npm test

License

MIT © Frederic Heem

Package Sidebar

Install

npm i restauth

Weekly Downloads

4

Version

1.1.1

License

MIT

Last publish

Collaborators

  • fheem