Skip to content

CommonGarden/rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grow-rest-api

Rest API for Grow-IoT project

Installation

git clone git@github.com:aruntk/grow-rest-api.git
npm install
npm 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

export APP_SECRET="super_secret_key"
npm 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>

Releases

No releases published

Packages

No packages published