done
This commit is contained in:
parent
6b0be193a5
commit
9f15c3ff1a
|
@ -9,8 +9,8 @@ import propertyRouter from "./routes/property.js";
|
|||
import mysqlRouter from "./routes/mysqlproperty.js";
|
||||
import adminRouter from "./routes/admin.js"
|
||||
import dotenv from "dotenv";
|
||||
import bcrypt from "bcryptjs";
|
||||
import adminModal from "./models/admin.js";
|
||||
// import bcrypt from "bcryptjs";
|
||||
// import adminModal from "./models/admin.js";
|
||||
|
||||
const app = express();
|
||||
dotenv.config();
|
||||
|
@ -70,13 +70,13 @@ dbConnectionPromise
|
|||
});
|
||||
|
||||
|
||||
const createAdminUser = async () => {
|
||||
const hashedPassword = await bcrypt.hash("Uer$99#KKma-hi19", 10);
|
||||
const admin = new adminModal({ username: "admin", password: hashedPassword });
|
||||
await admin.save();
|
||||
console.log("Admin user created.", admin);
|
||||
mongoose.disconnect();
|
||||
};
|
||||
// const createAdminUser = async () => {
|
||||
// const hashedPassword = await bcrypt.hash("Uer$99#KKma-hi19", 10);
|
||||
// const admin = new adminModal({ username: "admin", password: hashedPassword });
|
||||
// await admin.save();
|
||||
// console.log("Admin user created.", admin);
|
||||
// mongoose.disconnect();
|
||||
// };
|
||||
|
||||
createAdminUser();
|
||||
// createAdminUser();
|
||||
|
||||
|
|
Loading…
Reference in New Issue