text: 'use strict';
  
  const express = require('express');
  const template = require('./template');
  const routeContentMap = require('./route-content-map');
  
  const app = express();
  const port = 3333;
  
  Object.entries(routeContentMap).forEach(([route, content]) => {
  	app.get(route, (request, response) => response.send(template(content)));
  });
  
  app.get('/set-server-cookie', (request, response, next) => {
  	// sets an httpOnly server cookie
  	response.cookie('serverSetCookieName', 'serverCookieValue', {
  		httpOnly: true
  	});
  	response.send('cookie set');
  	next();
  });
  
  app.use((error, request, response, next) => {
  	if (response.headersSent) {
  		return next(error);
  	}
  	response.status(error.status);
  	console.error(error.stack);
  	response.render('error', {error: error});
  });
  
  app.listen(port, () => console.log(`Listening on port ${port}...`));
  