CommonGarden/rest-api

Name: rest-api

Owner: Common Garden

Description: Rest API for Grow-IoT project

Created: 2017-03-01 04:48:41.0

Updated: 2017-05-23 21:32:15.0

Pushed: 2017-03-01 05:14:40.0

Homepage: null

Size: 863

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

grow-rest-api

Rest API for Grow-IoT project

Installation

clone git@github.com:aruntk/grow-rest-api.git
install
run compile

Running

Start your meteor app(if you are using external mongo then ensure it is running).

By default mongo url is set as mongodb://localhost:3001/meteor (config.js)

If you want to change it to something else use set environment variable MONGO_URL

Set super secret key for jsonwebtoken (Default -> grow-iot-secret. inside config.js) env variable APP_SECRET

rt APP_SECRET="super_secret_key"
h
start

http://localhost:8080/api/things/

Use postman

Generate auth token

http://localhost:8080/api/authenticate/?username=<username>&password=<password>

token

Get Things

http://localhost:8080/api/things?token=<token>

http://localhost:8080/api/things/:thing_id?token=<token>

things

Get Events

http://localhost:8080/api/events?token=<token>

http://localhost:8080/api/events/:event_id?token=<token>


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.