-
MySQL, PostgreSQL, or SQLite
-
Create admin with password
-
Create database peaknode
-
Grant user priviledges
-
NodeJS - API Server ExpressJS - API Middleware SequelizeJS - PostgreSQL, MySQL, MariaDB, SQLite Middleware.
-
/app.js: Load and serve API resources
-
/config.json: Configuration info for port, DB, session, static models, etc.
-
/routes.js: API endpoints
-
/controllers: API endpoint handlers
-
/models: SequelizeJS models
-
/lib: NodeJS helper classes
-
/lib/database.js: Setup SequelizeJS models, relationships, and triggers
-
/lib/fitbit.js: Fitbit OAuth helper
-
/lib/omnilink.js: TCP connection to Java server
-
/lib/xbmc.js: XBMC connection/command helper
-
* - Requires sessionID
Method | Endpoint | Action |
---|---|---|
POST |
/user | Create User |
POST |
/login | Login User |
POST |
/logout | *Logout User |
POST |
/auth | *Check Auth |
GET |
/users | List Users |
GET |
/user/:uid | Show User |
Method | Endpoint | Action |
---|---|---|
GET |
/appliances | List Appliances |
POST |
/appliance/:id | *Switch Appliance |
Method | Endpoint | Action |
---|---|---|
GET |
/appliances | List Audio Zones |
GET |
/appliance/:id | Show Audo Zone |
POST |
/appliance/:id | *Set Audio Zone |
Method | Endpoint | Action |
---|---|---|
GET |
/security | Security Status |
GET |
/security/:id | |
POST |
/security/:id | *Set Audio Zone |
### User Routes #### Create User
- @body username
- @body password
- @body realname
- @body pinkey (4 digits)
- @body username
- @body password
- @param uid
### Appliance Routes #### List Appliances #### Switch Appliance
- @body state (on|off)
- @body node (left|right)
### Audio Routes #### List Audio Zones #### Show Audio Zone