Restful service is HTTP adapter for the front-end using native window fetch for making network calls
Install the dependencies and devDependencies and start the server.
$ npm install restful-service
or
$ yarn add restful-service
import { restGet, restPost } from 'restful-service';
const promise = restGet(urlString)();
promise.then(result => console.log(result));
const res = restPost(urlString)(payloadObject)();
res.then(r => console.log(r))
import { restGet, restPost } from 'restful-service';
const promise = restGet('https://jsonplaceholder.typicode.com/users')()
promise.then(result => console.log(result))
const promise = restPost('https://jsonplaceholder.typicode.com/posts')({
title: 'foo',
body: 'bar',
userId: 1
})();
promise.then(result => console.log(result))