From 3058ec0d2e6c8bf24d7e2547e96a9e2fd0646c69 Mon Sep 17 00:00:00 2001 From: "pi@anchor" Date: Wed, 9 Dec 2020 16:59:37 -0500 Subject: [PATCH] updates from darla --- run.txt | 4 ++++ server.js | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 run.txt diff --git a/run.txt b/run.txt new file mode 100644 index 0000000..c2b82be --- /dev/null +++ b/run.txt @@ -0,0 +1,4 @@ +sudo docker build -t timpreble/tsapi3:1.0.0 . + + +sudo docker run -d -p 3001:3001 --name tsapi3.1 --restart=always timpreble/tsapi3:1.0.0 diff --git a/server.js b/server.js index 99b7e0a..5715f7c 100755 --- a/server.js +++ b/server.js @@ -36,11 +36,12 @@ server.get('/api/today', function (req, res) { }); }); -server.get('/api/campaign',function(){ +server.get('/api/campaign',function(req, res){ connection.query('CALL CP_RPT_TweetsByScreenName ();',function(error, results, fields){ if(error) throw error; - //https://www.sitepoint.com/using-node-mysql-javascript-client/ - res.end(results); + //https://www.sitepoint.com/using-node-mysql-javascript-client/ + res.end(JSON.stringify(results)); + //res.end(results); }); });