From 06fcae38ef721ed200405faa56115acb2841fff7 Mon Sep 17 00:00:00 2001 From: jkaplon Date: Wed, 29 Jun 2016 08:16:21 -0400 Subject: [PATCH] Try to load /home template for testing, but broken; can't even get a log entry generated for the route/endpoint. --- server.js | 22 ++++++++++++++++++++++ views/default.hbs | 4 ---- views/home.hbs | 9 +++++++++ views/index.hbs | 4 ++++ 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 views/home.hbs diff --git a/server.js b/server.js index 303f725..5a3f261 100644 --- a/server.js +++ b/server.js @@ -195,6 +195,28 @@ app.get('/:loc/status', function(req, res) { } }); +// temp testing for static home pages. +app.get('/home', function(req, res) { + // Even when the winston call is the only thing in here...IT NO WORKY!!! + winston.info('GET /home'); + // try to sleep here + var exec = require('child_process').execSync; + var cmd = 'sleep(1)'; + winston.info(cmd); + exec(cmd, function(error, stdout, stderr) { + if (error) { winston.error(error); } + winston.info(stdout); + }); + //res.status(404).send('Not found'); + //res.render('home', {}, function(err, html) { + //if(err !== null) { + //winston.error(err); + //} else { + //res.send(html); + //} + //}); +}); + setInterval(function() { // Check every hour to see if GoodMorning or GoodEvening has gone missing. pg.connect(conString, function(err, client, done) { diff --git a/views/default.hbs b/views/default.hbs index 15386e2..393147c 100644 --- a/views/default.hbs +++ b/views/default.hbs @@ -33,10 +33,6 @@ -
-

TT Tennis Courts Are...

-
- {{! Everything else gets inserted here }} {{{body}}} diff --git a/views/home.hbs b/views/home.hbs new file mode 100644 index 0000000..4f72bb6 --- /dev/null +++ b/views/home.hbs @@ -0,0 +1,9 @@ +{{!< default}} + +
+

Are the courts open?

+
+
+

You can always know if the courts are open BEFORE you leave the house with TennisCourtsOpen.com

+
+ diff --git a/views/index.hbs b/views/index.hbs index e33536d..5e6cd65 100644 --- a/views/index.hbs +++ b/views/index.hbs @@ -1,5 +1,9 @@ {{!< default}} +
+

TT Tennis Courts Are...

+
+ {{! Index-0 is the most recent message. }}

{{values.0.status}}