File size: 999 Bytes
7e79d67 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 'use strict';
var controller = require('../controllers');
var helpers = require('../helpers');
module.exports = function(app, express) {
// ROUTE FOR RESETTING DB WITH DEMO DATA
app.get('/api/resetDBWithData', function(req, res){
controller.user.reset();
res.send('success');
});
// ROUTE FOR DISPLAYING DASHBOARD
app.get('/api/users/:user_id/clients', function(req,res){
controller.dashboard.get(req,res);
});
// ROUTE FOR CREATING A NEW CLIENT
app.post('/api/users/:user_id/clients', function(req,res){
controller.user.post(req,res);
});
// ROUTE FOR DISPLAYING PARTICULAR CLIENT
app.get('/api/users/:user_id/clients/:client_id', function(req,res){
controller.client.get(req,res);
});
// ROUTE FOR UPDATING A CLIENT
app.put('/api/users/:user_id/clients/:client_id', controller.client.put);
// ROUTE FOR GETTING FEED FOR A PARTICULAR CLIENT
app.get('/api/users/:user_id/clients/:client_id/feed', function(req,res){
controller.feed.getOneClient(req,res);
})
};
|