Git Product home page Git Product logo

raml-store's Introduction

RAML Store

Overview

raml-store provides a simple storage API plus a persistence plugin which enables you to run the RAML API Designer locally (rather than use the APIHub cloud service) and still be able to manage and collaborate on your design.

Requirements

The service is built with node.js, using express and mongodb.

Installing Node.js

Go to nodejs.org, and click the Install button.

Installing MongoDB

To install MongoDB on your specific platform, refer to the MongoDB QuickStart.

To start mongodb as background process:

cd /usr/local/mongodb (mongodb installation directory)

mongod --fork --logpath /var/log/mongodb.log

Installing MongoDB Node.js Driver

From the top-level directory (e.g. raml-store):

npm install mongodb

Installing Express

From the top-level directory (e.g. raml-store):

npm install

Running the Service

From the top-level directory (e.g. raml-store):

node server

If you prefer to run the server in the background forever is awesome.

npm install forever

forever start server

Testing the Service

curl -i -X POST -H 'Content-Type: application/json' -d '{"name":"myfirstapi.raml","path":"/","contents":"#%25RAML%200.8%0Atitle:%20%20%20DONE!!!"}' http://localhost:3000/files

curl -i -X GET http://localhost:3000/files

Integration with API-Designer

Follow instructions at api-designer to install and run API-Designer.

Where they reference embedding the designer, you can simply copy the sample-designer from this project into the api-designer app directory (https://github.com/brianmc/raml-store/blob/master/sample-designer.html).

The important code is the script beginning at line 75, ending at line 202.

Acknowledgements

Thanks to Christophe Coenraets, this API is based on his simple and easy-to-follow tutorial at http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/

raml-store's People

Contributors

brianmc avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.