Giter Site home page Giter Site logo

forge-api's Introduction

forge-api

The API for the forge-app. An API written with Hapi which hooks into a number of Seneca microsservices. The API can also be configured to run as a monolith by loading the microservices as plugins.

Services

Install in development mode

The api requires:

  • Node.js (version 4+)
  • MongoDB

Install Node

Follow instructions here.

Install MongoDB

Ubuntu 14.04

Import MongoDB public key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

Add the repo to sources.list:

echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

Update and install:

sudo apt-get update
sudo apt-get install -y mongodb-org

OSX

Using Homebrew:

brew update
brew install mongodb

Install the API

Clone:

git clone https://github.com/darragh-hayes/forge-app.git

Install:

npm install

Configuration

The app config exists in config.js. Most of the config options come from environment variables. Sane defaults are in place for local development.

The relevant environment variables are:

  • API_HOST - API hostname/ip
    • Default: 0.0.0.0
  • API_PORT - API port number
    • Default: 4000
  • forge_DEBUG - Enables debug logging on the server
    • true | false
    • Default: false
  • CALENDAR_HOST - Hostname/ip of calendar microservice
    • Default: 127.0.0.1
  • EXERCISES_HOST - Hostname/ip of exercises microservice
    • Default: 127.0.0.1
  • USERS_HOST - Hostname/ip of users microservice
    • Default: 127.0.0.1
  • MONGO_NAME - Name of Database
    • Default: forge
  • MONGO_HOST - Hostname/ip of MongoDB server
    • Default: 127.0.0.1
  • MONGO_PORT - MongoDB server port
    • Default: 27017
  • MONGO_USERNAME - Mongo username if access control is configured (recommended for production)
    • Default : null
  • MONGO_PASSWORD
    • Default : null
  • JWT_KEY - Secret key for encrypting and signing JSON web tokens.
    • Default: password
  • PRODUCTION - Determines whether the app runs as a monolith or not.
    • TRUE: The API runs by itself and will attempt to connect to external microservices. The other services must be installed and run
    • FALSE: The API loads the microservices as plugins and runs in a single process.
    • Default: FALSE

forge-api's People

Contributors

dhayes-test avatar darahayes avatar

Stargazers

 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.