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 mysqlRouter from "./routes/mysqlproperty.js";
|
||||||
import adminRouter from "./routes/admin.js"
|
import adminRouter from "./routes/admin.js"
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
import bcrypt from "bcryptjs";
|
// import bcrypt from "bcryptjs";
|
||||||
import adminModal from "./models/admin.js";
|
// import adminModal from "./models/admin.js";
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
@ -70,13 +70,13 @@ dbConnectionPromise
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const createAdminUser = async () => {
|
// const createAdminUser = async () => {
|
||||||
const hashedPassword = await bcrypt.hash("Uer$99#KKma-hi19", 10);
|
// const hashedPassword = await bcrypt.hash("Uer$99#KKma-hi19", 10);
|
||||||
const admin = new adminModal({ username: "admin", password: hashedPassword });
|
// const admin = new adminModal({ username: "admin", password: hashedPassword });
|
||||||
await admin.save();
|
// await admin.save();
|
||||||
console.log("Admin user created.", admin);
|
// console.log("Admin user created.", admin);
|
||||||
mongoose.disconnect();
|
// mongoose.disconnect();
|
||||||
};
|
// };
|
||||||
|
|
||||||
createAdminUser();
|
// createAdminUser();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue