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); }); });