A client for the Bloggify API functions (actions).
# Using npm
npm install --save bloggify-actions-client
# Using yarn
yarn add bloggify-actions-client
var BloggifyActionsClient = require("bloggify-actions-client");
var app = new BloggifyActionsClient("http://localhost:8080");
// Make a get request
app.get("action.name", {
query: { id: 2 }
}).then(function (_ref) {
var data = _ref.data;
console.log(data);
});
// Make a post request
app.post("action.name", {
name: "PipeOrgansMap"
}).then(function (_ref2) {
var data = _ref2.data;
console.log(data);
});
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. 🐛
BloggifyActionsClient A client for the Bloggify API functions (actions).
- String
host
: - Object
options
: An object containing the following fields: url
(String): The http actions base url (default:@/bloggify/actions
).ws_url
(String): The ws actions base url (default:!/bloggify/actions
).
Executes an HTTP(s) request.
- Object
opts
: Contains a set of parameters.headers
(Object) The request headers.url
(String) The access URL.action
(Object) The action name.method
(Function) The request method.data
(Object) The reuqest body (will be JSON-stringified)query
(Object) Querystring parameters to be set in the url.
- Function
cb
: The callback function.
Executes a POST request.
- String
name
: The action name. - Object
data
: The request body (as an object). - Object
opts
: Additional options (optional).
Executes a GET request.
- String
name
: The action name. - Object
opts
: Additional options (optional). - Function
cb
: The callback function.
Get the url of the action.
- String
name
: The action name. - Object
opts
: Additional options (optional).
- String The url string.
Get the url of the WebSocket action.
- String
name
: The action name.
- String The ws url string.
Have an idea? Found a bug? See how to contribute.