Latest Project, Trash and setting API and sockets along with the Model clearance

This commit is contained in:
2025-05-17 10:12:18 +05:30
parent c64e5ea8b5
commit 0b30a8aeaa
66 changed files with 1109 additions and 2351 deletions

View File

@@ -1,4 +1,4 @@
import mongoose, { Document, Schema } from "mongoose";
import { Document, Schema } from "mongoose";
import MainModel from "../connect/mongoose.ts";
export interface User extends Document {
userName: String;
@@ -48,24 +48,8 @@ const signupschema: Schema = new Schema({
default: [],
},
});
// const userModel = (db: string) => {
// const mongoUrl = process.env.MONGO_URI || "";
// if (!mongoUrl) {
// throw new Error("MONGO_URI environment variable is not set");
// }
// // Connect to the database
// const dbConnection = mongoose.createConnection(mongoUrl, {
// dbName: db, // Specify the database name here
// serverSelectionTimeoutMS: 30000,
// });
// // Return the model
// return dbConnection.model("Users", signupschema, "Users");
// };
// export default userModel;
const userModel = (db: string) => {
return MainModel(db, "Users", signupschema, "Users");
const userModel = (db:string) => {
return MainModel(db, "Users", signupschema, "Users")
};
export default userModel;