@frontender-magazine/fm-user

1.0.9 • Public • Published

Documentation

DummyService

Extends TMMicroServiceAPI

Dummy Micro Service API that you may adopt for your needs

Parameters

  • url string service url
  • token (string | null) user access tocken if available (optional, default null)

Array

Posts list object

Type: PostList

Properties

  • null-null Array<Post> array of posts

Post

Post object

Type: Post

Properties

messages

Object with class service messages

get

Get posts list

Examples

Read posts list

(async () => {
  const Dummy = new DummyService('https://jsonplaceholder.typicode.com/');
  const list = await Dummy.get();
})();

Returns PostList array of posts

post

Create post

Parameters

Examples

Create post

(async () => {
  const Dummy = new DummyService('https://jsonplaceholder.typicode.com/');
  const details = await Dummy.post('My Title', 'My Text');
})();

Returns Post created post

details

Read specific post

Parameters

Examples

Get post

(async () => {
  const Dummy = new DummyService('https://jsonplaceholder.typicode.com/');
  const details = await Dummy.details(2);
})();

Returns Post post content

Package Sidebar

Install

npm i @frontender-magazine/fm-user

Weekly Downloads

0

Version

1.0.9

License

CC-BY-4.0

Last publish

Collaborators

  • silentimp