const userController = require('./users/userController.js');
const listingController = require('./listings/listingController.js');

module.exports = (app, db) => {

  // Routes for all users
  app.get('/api/users', userController.getAll);
  app.post('/api/users', userController.createOne);

  // Routes for specific user
  app.get('api/users/:id', userController.getOne);
  app.patch('api/users/:id', userController.patchOne);
  app.delete('api/users/:id', userController.deleteOne);

  // Routes for all listings belonging to a specific user
  app.get('api/users/:id/listings', listingController.getAll);
  app.post('api/users/:id/listings', listingController.createOne);

  // Routes for a specific listing
  app.get('api/listings/:listId', listingController.getOne);
  app.patch('api/listings/:listId', listingController.patchOne);
  app.delete('api/listings/:listId', listingController.deleteOne);

  // Routes for a specific listing's photos
  app.get('api/listings/:listId/photos', listingController.getAllPhotos);
  app.post('api/listings/:listId/photos', listingController.createOnePhoto);

  // Routes for a specific listing's specific photo
  app.patch('api/listings/:listId/photos/:id', listingController.patchOnePhoto);
  app.delete('api/listings/:listId/photos/:id', listingController.deleteOnePhoto);

}
@@ -150,16 +150,32 @@
 (app, db
+, path, rootPath
 ) =%3E %7B%0A%0A
@@ -334,32 +334,33 @@
 user%0A  app.get('
+/
 api/users/:id', 
@@ -392,24 +392,25 @@
  app.patch('
+/
 api/users/:i
@@ -449,24 +449,25 @@
 app.delete('
+/
 api/users/:i
@@ -563,24 +563,25 @@
 %0A  app.get('
+/
 api/users/:i
@@ -628,24 +628,25 @@
   app.post('
+/
 api/users/:i
@@ -727,32 +727,33 @@
 ting%0A  app.get('
+/
 api/listings/:li
@@ -791,32 +791,33 @@
 );%0A  app.patch('
+/
 api/listings/:li
@@ -858,32 +858,33 @@
 ;%0A  app.delete('
+/
 api/listings/:li
@@ -976,16 +976,17 @@
 pp.get('
+/
 api/list
@@ -1052,16 +1052,17 @@
 p.post('
+/
 api/list
@@ -1184,16 +1184,17 @@
 .patch('
+/
 api/list
@@ -1267,16 +1267,17 @@
 delete('
+/
 api/list
@@ -1338,9 +1338,144 @@
 hoto);%0A%0A
+  // Catch-all route to allow reloading%0A  app.get('*', (req, res) =%3E %7B%0A    res.sendFile(path.resolve(rootPath + '/index.html'));%0A  %7D);%0A
 %7D

Add catch-all route to allow page refreshing