import mongoose from "mongoose";

export function needDatabase(res, req, next) {
    if (mongoose.connection.readyState != 1) {
        res.status(500).send("Internal server error: Database connection faulty.");
    } else {
        next();
    }
}