git clone https://github.com/acntech/ads-api.git
cd ads-api
npm install
start mongoDB in another terminal or background (MacOSX: mongod, Windows: ?)
Start API node server by: node server.js
You should be able to test REST API for the ADS API Open a web browser and go to http://localhost:5000/api/player
Tip: use Chrome Rest Console to test the REST API.
| HTTP Action | Route | Description |
|---|---|---|
| GET | /api/player | Read all MPs |
| GET | /api/player/:id | Read Media Player by ID |
| PUT | /api/player/:id | Update existing Media Player by ID |
| POST | /api/player | Create new Media Player |
| DELETE | /api/player/:id | Delete existing Media Player by ID |
name: {
type: String,
trim: true
},
ip: String,
location: {
floor: {
type: Number,
min: 2,
max: 4
},
zone: {
type: String,
default: 'external'
}
},
isActive: {
type: Boolean,
default: false
},
created: {
type: Date,
default: Date.now
},
updated: {
type: Date,
default: Date.now
}
[
{
"name": "Ruby",
"ip": "127.0.0.100",
"_id": "5240cef5b17cf20200000001",
"__v": 0,
"updated": "2013-09-23T23:29:57.541Z",
"created": "2013-09-23T23:29:57.540Z",
"isActive": true,
"location": {
"floor": 2,
"zone": "external"
}
},
{
"name": "Scala",
"ip": "127.0.0.101",
"_id": "5240cef5b17cf20200000002",
"__v": 0,
"updated": "2013-09-23T23:29:57.546Z",
"created": "2013-09-23T23:29:57.546Z",
"isActive": true,
"location": {
"floor": 2,
"zone": "external"
}
}
]