Try to load /home template for testing, but broken; can't even get a log entry generated for the route/endpoint.
This commit is contained in:
		
							parent
							
								
									c2c8624baa
								
							
						
					
					
						commit
						06fcae38ef
					
				
							
								
								
									
										22
									
								
								server.js
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								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() {
 | 
					setInterval(function() {
 | 
				
			||||||
    // Check every hour to see if GoodMorning or GoodEvening has gone missing.
 | 
					    // Check every hour to see if GoodMorning or GoodEvening has gone missing.
 | 
				
			||||||
    pg.connect(conString, function(err, client, done) {
 | 
					    pg.connect(conString, function(err, client, done) {
 | 
				
			||||||
 | 
				
			|||||||
@ -33,10 +33,6 @@
 | 
				
			|||||||
</head>
 | 
					</head>
 | 
				
			||||||
<body class="container-fluid">
 | 
					<body class="container-fluid">
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    <div style="background:#D1E0E0" class="jumbotron">
 | 
					 | 
				
			||||||
        <h1 class="text-center">TT Tennis Courts Are...</h1>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    {{! Everything else gets inserted here }}
 | 
					    {{! Everything else gets inserted here }}
 | 
				
			||||||
    {{{body}}}
 | 
					    {{{body}}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										9
									
								
								views/home.hbs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								views/home.hbs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
				
			|||||||
 | 
					{{!< default}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<div class="jumbotron">
 | 
				
			||||||
 | 
					    <h1 class="text-center"><b>Are the courts open?</b></h1>
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
 | 
					<hr></hr>
 | 
				
			||||||
 | 
					<h2 class="text-center">You can always know if the courts are open BEFORE you leave the house with <a href="https://tenniscourtsopen.com">TennisCourtsOpen.com</a></h2>
 | 
				
			||||||
 | 
					<hr></hr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1,5 +1,9 @@
 | 
				
			|||||||
{{!< default}}
 | 
					{{!< default}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<div style="background:#D1E0E0" class="jumbotron">
 | 
				
			||||||
 | 
					    <h1 class="text-center">TT Tennis Courts Are...</h1>
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{{! Index-0 is the most recent message. }}
 | 
					{{! Index-0 is the most recent message. }}
 | 
				
			||||||
<div class="jumbotron {{values.0.statusclass}}">
 | 
					<div class="jumbotron {{values.0.statusclass}}">
 | 
				
			||||||
    <h1 class="text-center"><b>{{values.0.status}}</b></h1>
 | 
					    <h1 class="text-center"><b>{{values.0.status}}</b></h1>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user