Added rental controller to server routes.
This commit is contained in:
parent
8f96a2e5c9
commit
98ea02b56c
@ -111,4 +111,6 @@ rentalController.delete("/:id", needDatabase, requireAuthenticated, async (req,
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
res.status(500).send("Internal server error");
|
res.status(500).send("Internal server error");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export default rentalController;
|
@ -7,6 +7,7 @@ import SportController from "./controllers/sportController.js";
|
|||||||
import { userSession } from "./middleware/authority.js";
|
import { userSession } from "./middleware/authority.js";
|
||||||
import { mongooseDbName, mongoURI } from "./database/mongoose.js";
|
import { mongooseDbName, mongoURI } from "./database/mongoose.js";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
|
import rentalController from "./controllers/rentalController.js";
|
||||||
|
|
||||||
const server = express();
|
const server = express();
|
||||||
const port = process.env.PORT || 5000;
|
const port = process.env.PORT || 5000;
|
||||||
@ -40,7 +41,7 @@ server.use(userSession);
|
|||||||
server.use("/user", UserController);
|
server.use("/user", UserController);
|
||||||
server.use("/match", MatchController);
|
server.use("/match", MatchController);
|
||||||
server.use("/sport", SportController);
|
server.use("/sport", SportController);
|
||||||
|
server.use("/rental", rentalController);
|
||||||
|
|
||||||
server.listen(port, () => {
|
server.listen(port, () => {
|
||||||
console.log(`Server listening on port ${port}.`);
|
console.log(`Server listening on port ${port}.`);
|
||||||
|
Loading…
Reference in New Issue
Block a user