diff --git a/index.js b/index.js index 40d852a..ee94e34 100644 --- a/index.js +++ b/index.js @@ -33,9 +33,8 @@ server.get('/list_sources', function (req,res) { Postgres.FirstRow(sql,[],res); }) -server.get('/rep_list', bodyParser.json(), function (req,res) { +server.get('/monthly_orders', bodyParser.json(), function (req,res) { - //console.log(JSON.stringify(req.body)); var w = ""; var c = 1; var args = []; @@ -51,6 +50,10 @@ server.get('/rep_list', bodyParser.json(), function (req,res) { args.push(req.body[i]); c = c + 1; }; + if (c == 1) { + res.send("no body was sent"); + return; + } //console.log(w); //console.log(args); w = @@ -81,6 +84,6 @@ server.get('/rep_list', bodyParser.json(), function (req,res) { //res.json("hi") }) -server.get('/', (req,res) => res.send('its running yay 🎡')) +server.get('/', (req,res) => res.send('node.js express is running: 🎉')) server.listen(3000,() => console.log('started'))