Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

binda-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binda-api

  • 0.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Binda API

A GraphQL API for Binda CMS.

Binda is a headless CMS with an intuitive out-of-the-box interface which makes very easy creating application infrastructures. For more info about Binda structure please visit the official documentation

Maintainability Test Coverage

Quick start

Install Binda APi via terminal

gem install binda-api

alternatively add the gem to your application's Gemfile:

gem 'binda-api'

Then execute:

bundle install

(If you have installed Binda already you can skip next steps)

Setup the database. If you are going to use Postgres set it up now.

To complete binda installation run the installer from terminal. Binda will take you through a short configuration process where you will setup the first user and some basic details.

rails generate binda:install

Now you are good to go. Good job!

Query

Binda API is based on GraphQL.

Here below an example of a simple query that retrives the name of all post components using Axios library.

axios
	.post(
		"http://my.domain.com/graphql",
		{ query: "{ components(slug: \"post\"){ edges { node { name } } }}" },
		{ headers: { "Content-Type": "application/json" } }
	)
	.then(response => response.data)
	.catch(error => {
		throw error;
	})

This is one of the possible approaces to access Binda content with GraphQL. Feel free to make requests to GraphQL as you prefer.

GraphiQL and Binda API documentation

Binda API documentation is integrated in the GraphiQL panel which is accessible from /admin_panel/graphiql. In your local environment this would be http://localhost:3000/admin_panel/graphiql (if you use port 3000).

Absolute URL

If Binda is using a CDN to store all assets you should already receive a proper absolute URL. If insted you are storing assets inside public folder (see Carrierwave documentation) Binda API will give you a relative path.

You can fix this issue modify few lines of the CMS application on which Binda is installed.

Assuming that you set a environmental variable BINDA_ASSET_HOST

BINDA_ASSET_HOST=http://your.domain.com

Add this line to config/environments/production.rb

config.action_controller.asset_host = ENV['BINDA_ASSET_HOST']

Add also this line to config/initializers/carrierwave.rb

config.asset_host = ActionController::Base.asset_host

FAQs

Package last updated on 21 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc