Added rental controller to server routes.

This commit is contained in:
Harrison Deng 2022-04-05 11:54:06 -05:00
parent 8f96a2e5c9
commit 98ea02b56c
2 changed files with 5 additions and 2 deletions

View File

@ -111,4 +111,6 @@ rentalController.delete("/:id", needDatabase, requireAuthenticated, async (req,
console.error(error);
res.status(500).send("Internal server error");
}
});
});
export default rentalController;

View File

@ -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}.`);