Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

blocknotes/hydra-grape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hydra-grape - PROJECT UNMAINTAINED

This project is not maintained anymore

If you like it or continue to use it fork it please.



A multi-project API system.

Features:

  • create REST API using specific endpoints (called collections)
  • create group of API (called projects)
  • simple auth using tokens
  • built using Grape, a Mongo DB is required

hydra

Examples

  • Endpoint to create a new project:
curl -X POST 'http://localhost:3000/api/v1/projects' -H 'Content-Type: application/json' --data '{"name":"MyProject","code":"prj","url":"https://www.google.com"}'
  • Endpoint to create a collection (using a project id):
curl -X POST 'http://localhost:3000/api/v1/collections/58b1dc2bf571550470276cc2' -H 'Content-Type: application/json' --data '{"name":"authors","singular":"author","columns":{"first_name":"String","last_name":"String","age":"Integer"}}'
  • Endpoint to create a new item (using a project code and a collection name):
curl -X POST 'http://localhost:3000/api/v1/items/prj_authors' -H 'Content-Type: application/json' --data '{"data":{"first_name":"John","last_name":"Doe","age":"25"}}'
  • Endpoint to list entries:
curl 'http://localhost:3000/api/v1/items/prj_authors'

Setup

  • Prepare database:
rake db:mongoid:drop
rake db:mongoid:create_indexes

Dev / More examples

  • See specific document: here

About

Multi-Project API System

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages