aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-06-29 23:22:40 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-06-29 23:22:40 +0200
commit124666fbac0762a8edaf4ed3880e897f84188583 (patch)
tree44caf56a98e602a643584efb732f8c54b5efdebc
parent2a78df9bd4059344b2133830eebe28fccaff8c81 (diff)
downloadexample-collection-json-db-124666fbac0762a8edaf4ed3880e897f84188583.tar.gz
example-collection-json-db-124666fbac0762a8edaf4ed3880e897f84188583.tar.bz2
example-collection-json-db-124666fbac0762a8edaf4ed3880e897f84188583.tar.xz
example-collection-json-db-124666fbac0762a8edaf4ed3880e897f84188583.zip
o Less logging.
-rw-r--r--routes/index.js12
1 files changed, 0 insertions, 12 deletions
diff --git a/routes/index.js b/routes/index.js
index 0ecec65..5676d27 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -5,22 +5,12 @@ var collection_json = require('collection_json')
var now='2000-01-01';
function mapRow(row) {
- console.log('mapRow', row);
var data = _.map(row, function(value, key) {
return {name: key, value: value};
});
- console.log('mapRow', row, data);
return { data: data };
}
-function mapEmployee(row) {
- return {
- data: [
- {name: 'first_name', value: row.first_name}
- ]
- };
-}
-
exports.departments = function(req, res){
pg.connect(process.env.DATABASE_URL, function(err, client) {
if(err) throw err;
@@ -80,9 +70,7 @@ exports.employee = function(req, res){
client.end();
if(req.accepts('application/vnd.collection+json')) {
var items = [ mapRow(employee) ];
- console.log('items', items);
var object = collection_json.fromObject({collection: {items: items}});
- console.log('object', object);
res.contentType('application/vnd.collection+json');
res.send(JSON.stringify(object), 200);
}