mirror of
https://github.com/Leado123/sharesyllabus-server.git
synced 2026-10-01 00:13:00 +00:00
yyy
This commit is contained in:
+4
-1
@@ -395,5 +395,8 @@ app.post("/moderator/flag", jwtMiddleware, async (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await new Promise<void>((resolve) =>
|
await new Promise<void>((resolve) =>
|
||||||
httpServer.listen({ port: 4000, host: "0.0.0.0" }, resolve),
|
httpServer.listen({ port: 4000, host: "0.0.0.0" }, () => {
|
||||||
|
console.log("🚀 Server is running on http://0.0.0.0:4000");
|
||||||
|
resolve();
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
+2
-10
@@ -728,16 +728,8 @@ export async function seedDatabase() {
|
|||||||
const shouldSeed = process.env.SEED_DATABASE !== "false";
|
const shouldSeed = process.env.SEED_DATABASE !== "false";
|
||||||
|
|
||||||
if (shouldSeed) {
|
if (shouldSeed) {
|
||||||
seedDatabase()
|
await seedDatabase();
|
||||||
.then(() => {
|
console.log("🎉 Seeding finished successfully!");
|
||||||
console.log("🎉 Seeding finished successfully!");
|
|
||||||
process.exit(0);
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error("💥 Seeding failed:", error);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
console.log("⏭️ Skipping database seeding (SEED_DATABASE=false)");
|
console.log("⏭️ Skipping database seeding (SEED_DATABASE=false)");
|
||||||
process.exit(0);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user