Harrison Deng
ba566040b1
Started improved client code structure. Implemented session based authentication serverside. Implemented user, match, and sport database models serverside. Implemented Controllers for variety of C and R operations of CRUD.
9 lines
248 B
JavaScript
9 lines
248 B
JavaScript
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();
|
|
}
|
|
} |