Coder Social home page Coder Social logo

raml-store's Introduction

RAML API Designer with HDFS

This version of RAML's API designer uses the Hadoop Distributed File System (HDFS) as the persistence layer of storing RAML files. User authentication will be done through Nginx, and the application will grab the username from the request header.

The module 'request' is being used to send HTTP requests to HDFS.

The module 'winston' is being used for logging.

Installation steps

You need to have access to a Hadoop server to use the application.

To install the node modules, run npm install in the main directory (where package.json is).

To start the application, run node server.js in the same directory.

Configurations

By default, the application will run on port 3000. To change the port, edit this line in server.js:

app.set('port', process.env.PORT || 3000);

To configure the HDFS server that the applicaiton will use edit this block in 'routes/files.js':

/** SERVER CONFIGURATION **/
var host = 'http://localhost';
var port = ':50070';
// This is the directory that will store the userNames and RAML files in HDFS (e.g. /webhdfs/v1/users/jake/myRaml.raml)
var filePath = '/webhdfs/v1/users/';
// Change this if any administrative privileges are needed (e.g. '&user.name=root')
var user_access_name = '';
/*************************/

To change the name of the log file edit this line in 'files.js':

var log_file = "RAML_Store.log";

The username is extracted from a webserver in the findAll function in files.js:

/** Getting username from a webserver Authorization **/
var headers = req.header("authorization");
// Remove BASIC tag
var sub = headers.substring(6, headers.length)
// Decode header from base 64 to a string
var buffer = new Buffer(sub, 'base64');
var decoded = buffer.toString();
// Split and grab the Username
var index = decoded.indexOf(':');
userName = decoded.substring(0, index);

raml-store's People

Contributors

andrewlaguna824 avatar jacobvanassche avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.