From 98ea02b56c96e8a926f63a186acb02334c8bcf53 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Tue, 5 Apr 2022 11:54:06 -0500 Subject: [PATCH] Added rental controller to server routes. --- sports-matcher/server/controllers/rentalController.js | 4 +++- sports-matcher/server/server.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sports-matcher/server/controllers/rentalController.js b/sports-matcher/server/controllers/rentalController.js index 2bf67ce..616c09b 100644 --- a/sports-matcher/server/controllers/rentalController.js +++ b/sports-matcher/server/controllers/rentalController.js @@ -111,4 +111,6 @@ rentalController.delete("/:id", needDatabase, requireAuthenticated, async (req, console.error(error); res.status(500).send("Internal server error"); } -}); \ No newline at end of file +}); + +export default rentalController; \ No newline at end of file diff --git a/sports-matcher/server/server.js b/sports-matcher/server/server.js index 08dbae4..dcb9da6 100644 --- a/sports-matcher/server/server.js +++ b/sports-matcher/server/server.js @@ -7,6 +7,7 @@ import SportController from "./controllers/sportController.js"; import { userSession } from "./middleware/authority.js"; import { mongooseDbName, mongoURI } from "./database/mongoose.js"; import cors from "cors"; +import rentalController from "./controllers/rentalController.js"; const server = express(); const port = process.env.PORT || 5000; @@ -40,7 +41,7 @@ server.use(userSession); server.use("/user", UserController); server.use("/match", MatchController); server.use("/sport", SportController); - +server.use("/rental", rentalController); server.listen(port, () => { console.log(`Server listening on port ${port}.`);