### tm-service-dummy

`1.0.0`
Need help reading this?

### DummyService

Dummy Micro Service API that you may adopt for your needs

new DummyService(url: string, token: (string | null))

Extends TMMicroServiceAPI

Parameters
url `(string)` service url
token `((string | null) = `null`)` user access tocken if available
Static Members
▸ messages

Object with class service messages

messages
▸ get()

Get posts list

get(): PostList
Returns
`PostList`: array of posts
Example

Read posts list

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

▸ post(title, body)

Create post

post(title: string, body: string): Post
Parameters
title `(string)` post title
body `(string)` post body
Returns
`Post`: created post
Example

Create post

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

▸ details(id)

Read specific post

details(id: number): Post
Parameters
id `(number)` post id
Returns
`Post`: post content
Example

Get post

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

Instance Members
▸ Array

Posts list object

Array

Type: PostList

Properties
null-null `(Array<Post>)` : array of posts
▸ Post

Post object

Post

Type: Post

Properties
id `(number)` : post id
title `(string)` : post title
body `(string)` : post body