- Git
- NodeJS and npm
- MongoDB
- Heroku Toolbelt
- A Heroku user account (see step 1,2 and 3)
- Chrome Rest Console
git clone https://github.com/ismarslomic/ads-cms-backend.git
cd ads-cms-backend
heroku login // only first time
git clone git@heroku.com:ads-cms-backend.git distHeroku
npm install
grunt build:heroku
cd distHeroku
node server
You should be able to test REST API for the ADS CMS Backend. Open a web browser and go to http://localhost:5000/api/player
All of these tasks should be ran from the root folder of the project.
grunt build:heroku
- builds and optimization of the code in app folder. Destination folder is distHerokugrunt deploy:heroku
- build and deploy of distHeroku folder to Heroku application ads-cms-frontendgrunt run:heroku
- scales the Heroku application to 1 dyno and runs it in the web browsergrunt stop:heroku
- scales the Heroku application down to 0 dyno and stops the application
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"
}
}
]
- Heroku application: http://ads-cms-backend.herokuapp.com
- Heroku GIT:
git@heroku.com:ads-cms-backend.git
- TODO: information about the frontend app in Heroku