2022-04-01 10:27:58 -05:00
|
|
|
import mongoose from "mongoose";
|
2022-04-01 05:29:20 -05:00
|
|
|
|
|
|
|
export function needDatabase(res, req, next) {
|
|
|
|
if (mongoose.connection.readyState != 1) {
|
|
|
|
res.status(500).send("Internal server error: Database connection faulty.");
|
|
|
|
} else {
|
|
|
|
next();
|
|
|
|
}
|
|
|
|
}
|