This commit is contained in:
fans 2017-05-26 10:48:48 +00:00 committed by GitHub
commit 1b8935d649
3 changed files with 25 additions and 0 deletions

View file

@ -91,6 +91,20 @@ app.get('/pagecount', function (req, res) {
}
});
app.get('/home', function (req, res) {
res.render('home.html', {pageCountMessage: null})
// if (!db) {
// initDb(function (err) {});
// }
// if (db) {
// var col = db.collection(counts);
// col.count(function (err, count) {
// res.render('home.html', {pageCountMessage : count, dbInfo: dbDetails });
// });
// }else{
// res.render('home,html', {pageCountMessage: null});
// }
});
// error handling
app.use(function(err, req, res, next){
console.error(err.stack);

View file

@ -28,4 +28,14 @@ describe('Basic routes tests', function() {
})
})
it('GET to /home should return 200', function(done){
chai.request(reqServer)
.get('/home')
.end(function(err, res) {
res.should.have.status(200);
done();
})
})
})

1
views/home.html Normal file
View file

@ -0,0 +1 @@
home page