Skip to content

cran-io/prismetic-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dex Server

Build Status

Mongoose Models

User

{
  _id: String,
  createdAt: Date,
  name: String,
  lastName: String,
  mail: String,
  password: String
}

Account

{
  _id: String,
  createdAt: Date,
  name: String,
  address: String,
  users: [String],
  devices: [String]
}

Devices

{
  _id: String,
  createdAt: Date,
  updatedAt: Date,
  model: String,
  active: Boolean,
  sensors: [String]
}

Sensors

{
  _id: String,
  createdAt: Date,
  active: Boolean,
  name: String,
  sensorsData: [String]
}

SensorsData

{
  _id: String,
  createdAt: Date,
  state: String,
  sentAt: Date
}

--- Routes ---

Account

POST /accounts

Creates a new account.

Params: {
  name: String,
  address: String
}

Users

POST /accounts/:accountId/users

Creates a new user for an account.

Params: {
  mail: String,
  password: String,
  name: String,
  lastName: String
}

Device

POST /devices

Creates a new device for an account.

Params: {
  model: String,
  active: Boolean,
  accountId: String (el ID del account al que pertenece)
}

Sensor

POST /devices/:device_id/sensors

Creates a new sensor for a device.

Params: {
  name: String,
  active: Boolean
}

Sensor Data

POST /devices/:device_id/sensors/:sensor_id/sensors_data

Creates a new sensor data for a sensor.

Params: {
  state: String (Entro o Salio),
  sentAt: Date
}

####Deploy: Just run:

$ pm2 deploy ecosystem.json production

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published