text: const express = require('express')
  const cors = require('../middleware/cors')
  
  const router = express.Router()
  const { ensureAuthenticated } = require('../middleware/isAuth')
  
  // search a user
  router.get('/', cors.corsWithOptions, ensureAuthenticated, (req, res) => {
    res.render('users', {
      htmlTitle: 'Search Users',
    })
  })
  
  // user page
  router.get(
    '/:userID',
    cors.corsWithOptions,
    ensureAuthenticated,
    (req, res) => {
      res.render('user', {
        htmlTitle: 'User Page',
      })
    }
  )
  
  module.exports = router
  