Skip to content
A simple express api for recording home automation events
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api
bin
config
.dockerignore
.env.example
.gitignore
.travis.yml
Dockerfile
Dockerfile.test
README.md
docker-compose.test.yml
docker-compose.yml
index.js
package.json

README.md

Home Recorder


The purpose of this app is to expose an endpoint to record home events. In future releases I will have a Node Red integration.

How to run

Standard machine installation is simple. Make sure you have the following environment setup.

Environment

  • Node: v7.4.0
  • npm: v4.0.5
  • mongodb: min v2.6.5 to v3.0.4

Setup

  1. Make sure you have all the right dependencies by running npm install
  2. Setup your .env file. Just run cp .env.example .env
  3. Make any changes to the configuration
  4. You can stage a user for authentication routes by running node bin/stage.user.js

To customize the user edit the User in the stage.user.js file.

Running Tests

Simply run npm test

Running the Development Server

Just run npm start

Using Docker

Don't want to pollute your local machine and have docker installed then simply use the provided bin scripts.

Running Tests

Simply run ./bin/test.sh

Run the server in a container

  1. Start the container, ./bin/development.sh
  2. Find the container id, docker ps
  3. Add a user, docker exec -it <api container id> node bin/stage.user.js
You can’t perform that action at this time.