Skip to content

API Setup

Christoffer Rødvik edited this page Nov 2, 2015 · 3 revisions

WaiveCar API utilizes the BentoJS platform to service front end services. Before starting make sure you have installed mysql, mongo, and redis on your development server.

Once installed clone the api/development branch to its own directory, enter the api root and run the following commands.

# Install global dependencies
$ npm install -g bentojs nodemon

# Install npm dependencies
$ npm install

# Install packages
$ bento package

Before running the API make sure to go through the configurations and add local.js configurations where it's applicable for your environment.

Running the API using your local configuration run the following:

$ npm run local

To run the API on a custom environment you can start the API like so:

$ NODE_ENV=environment node app.js

WaiveCar is using sockets for live relay updates to our consumer devices. Make sure to test this by running the separate socket service.

# Local socket
$ npm run socket
# Custom environment
$ NODE_ENV=environment node socket

Make sure to have set the socket configuration to hit the proper endpoint the API is running on so that your clients can get authenticated.

Clone this wiki locally