import config from '../config.js'; import { getStorage } from '../storage/index.js'; export default (req, res, next)=>{ // Bypass DB checks during testing if(config.get('node_env') == 'test') return next(); // [fork] ADR-0002: aktives Storage-Backend (Mongo oder Postgres) statt mongoose.connection.readyState if(getStorage().isReady()) return next(); throw { HBErrorCode : '13', name : 'Database Connection Error', message : 'Unable to connect to database', status : 0 }; };