text: 'use strict';
  
  const express = require('express');
  const app = express();
  
  const notFoundHandler = require('./handlers/404.js')
  const errorHandler = require('./handlers/500.js')
  const stamper = require('./middleware/stamper.js');
  
  app.get('/', stamper, (req,res) => {
      res.status(200).send('Hello World')
  })
  
  app.get('/data', stamper, (req, res) => {
      let output = {
          10: "even",
          5: "odd",
          "time": req.timestamp
          }
      res.status(200).json(output);
  });
  
  
  app.get("/bad", (req, res, next) =>{
      next("you messed up")
  });
  
  app.use("*", notFoundHandler);
  app.use(errorHandler);
  
  function start(port){
      app.listen(port, () => console.log(`Server on port ${port}`))
  }
  
  module.exports = {
      app: app,
      start: start
  }