old_contents: const express = require('express');
  const hbs = require('hbs');
  const fs = require('fs');
  
  const port = process.env.PORT || 3000; 
  
  var app = express();
  
  hbs.registerPartials(__dirname + '/views/partials');
  app.set('view engine', 'hbs');
  
  
  app.use( (req,res,next) => {
      var now = new Date().toString();
      var log = `${now}: ${req.method} ${req.url}`;
      console.log(log);
      fs.appendFile('server.log',log + '\n', (err) => {
          if(err){
              console.log('Unable to write to the file');
          }
      });
      next();
  })
  
  app.use((req,res,next) => {
      res.render('maintenance.hbs');
  });
  
  app.use( express.static(__dirname + '/public'));
  
  hbs.registerHelper('getCurrentYear', () => {
     return new Date().getFullYear();
  });
  
  hbs.registerHelper('screamIt', (text) => {
      return text.toUpperCase();
  })
  app.get('/', (req, res) => {
      // res.send('<h1>Hello Express!</h1>');
      res.render('home.hbs', {
          pageTitle: 'home Page',
          welcomeMessage: 'Welcome bitch!',
      });
  });
  
  app.get('/about', (req, res) => {
  res.render('about.hbs', {
      pageTitle: 'About Page',
  });
  });
  
  app.get('/bad', (req, res) => {
      res.send({
          error: 'Bad Request'
      });
      });
  app.listen(port, () => {
      console.log(`Server is up on port ${port}`);
  });
new_contents: const express = require('express');
  const hbs = require('hbs');
  const fs = require('fs');
  
  const port = process.env.PORT || 3000; 
  
  var app = express();
  
  hbs.registerPartials(__dirname + '/views/partials');
  app.set('view engine', 'hbs');
  
  
  app.use( (req,res,next) => {
      var now = new Date().toString();
      var log = `${now}: ${req.method} ${req.url}`;
      console.log(log);
      fs.appendFile('server.log',log + '\n', (err) => {
          if(err){
              console.log('Unable to write to the file');
          }
      });
      next();
  })
  
  // app.use((req,res,next) => {
  //     res.render('maintenance.hbs');
  // });
  
  app.use( express.static(__dirname + '/public'));
  
  hbs.registerHelper('getCurrentYear', () => {
     return new Date().getFullYear();
  });
  
  hbs.registerHelper('screamIt', (text) => {
      return text.toUpperCase();
  })
  app.get('/', (req, res) => {
      // res.send('<h1>Hello Express!</h1>');
      res.render('home.hbs', {
          pageTitle: 'home Page',
          welcomeMessage: 'Welcome bitch!',
      });
  });
  
  app.get('/about', (req, res) => {
  res.render('about.hbs', {
      pageTitle: 'About Page',
  });
  });
  
  app.get('/bad', (req, res) => {
      res.send({
          error: 'Bad Request'
      });
      });
  app.listen(port, () => {
      console.log(`Server is up on port ${port}`);
  });
subject: remove maintenance mode