tonic + npm: beautapi

node v4.9.1
version: 1.0.0
endpointsharetweet
const Beautapi = require("beautapi"); const Fetch = require("node-fetch"); const model = { Posts: { getAll: "/posts", get: "posts/:id", } }; const config = { endpointPrefix: "http://jsonplaceholder.typicode.com", fetchReference: Fetch, thenChain: [ Beautapi.helpers.parseJSON ] }; const Api = Beautapi.parse(model, config); Api.Posts.getAll() .then((response) => { console.log(response); }) .catch((err) => { console.err(err); })
Created from: https://tonicdev.com/npm/beautapi
Loading…

no comments

    sign in to comment