Extends TMMicroServiceAPI
Dummy Micro Service API that you may adopt for your needs
Parameters
urlstring service urltoken(string | null) user access tocken if available (optional, defaultnull)
Posts list object
Type: PostList
Properties
null-nullArray<Post> array of posts
Post object
Type: Post
Properties
Object with class service messages
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
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
Read specific post
Parameters
idnumber post id
Examples
Get post
(async () => {
const Dummy = new DummyService('https://jsonplaceholder.typicode.com/');
const details = await Dummy.details(2);
})();Returns Post post content