var express = require('express');
var converter = require('json-2-csv');

var router = express.Router();

/* POST */
router.post('/', function(req, res, next) {
  res.send('Under Construction');
});

module.exports = router;

@@ -1,12 +1,28 @@
+// dependencies%0A
 var express 
@@ -43,16 +43,57 @@
 ress');%0A
+var bodyParser = require('body-parser');%0A
 var conv
@@ -124,16 +124,32 @@
 csv');%0A%0A
+// router setup%0A
 var rout
@@ -170,16 +170,47 @@
 outer();
+%0Arouter.use(bodyParser.json());
 %0A%0A/* POS
@@ -228,16 +228,24 @@
 .post('/
+csv2json
 ', funct
@@ -270,47 +270,579 @@
 ) %7B%0A
+%0A
   
-res.send('Under Construction'
+// if post request is empty or falsey%0A  if (!req.body %7C%7C Object.keys(req.body).length === 0) %7B%0A    return res.sendStatus(400);%0A  %7D%0A%0A  // convert to json through npm module%0A  // get first item (csv) in given json data%0A  converter.csv2json(req.body%5B0%5D, function(err, json) %7B%0A    if (err) throw err;%0A    // console.log(json);%0A%0A    // set correct content type; automatically detected in express%0A    // for explicity/mirroing/educational purposes%0A    res.set(%7B%0A      'Content-Type': 'application/json',%0A    %7D)%0A    res.send(json
 );%0A
+  
 %7D);%0A%0A
+%7D);%0A%0A// export for router in app.js%0A
 modu

Add csv2json route