User, match, sport schemas added.
This commit is contained in:
9
server/middleware/Database.js
Normal file
9
server/middleware/Database.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { mongoose } from "../database/mongoose.js";
|
||||
|
||||
export function needDatabase(res, req, next) {
|
||||
if (mongoose.connection.readyState != 1) {
|
||||
res.status(500).send("Internal server error: Database connection faulty.");
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user