From 487e71c1e7e0f3283337d0da66ce06bcae272a20 Mon Sep 17 00:00:00 2001 From: Trowbridge Date: Tue, 5 Mar 2019 23:57:31 -0500 Subject: [PATCH] rearrange routes --- index.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/index.js b/index.js index 52033b7..e0e48b4 100644 --- a/index.js +++ b/index.js @@ -30,6 +30,25 @@ Postgres.FirstRow = function (inSQL, args, inResponse) { }); }; +server.get('/', (req, res) => res.send('node.js express is up and running')) + + +server.get('/test_sql', function(req, res){ + var path = './route_meta/scenario_totals.sql' + var callback = function(arg){ + res.send(arg) + }; + + fs.readFile(path, 'utf8', function(err, data){ + if (!err){ + callback(data); + } else { + callback(err); + } + }); + +}); + server.get('/scenario_package', bodyParser.json(), function (req, res) { var w = ""; @@ -281,23 +300,4 @@ server.get('/get_pool', bodyParser.json(), function (req, res) { //res.json("hi") }) -server.get('/', (req, res) => res.send('node.js express is up and running')) - - -server.get('/test_sql', function(req, res){ - var path = './route_meta/scenario_totals.sql' - var callback = function(arg){ - res.send(arg) - }; - - fs.readFile(path, 'utf8', function(err, data){ - if (!err){ - callback(data); - } else { - callback(err); - } - }); - -}); - server.listen(3000, () => console.log('started'))