Add files via upload

This commit is contained in:
Mohammad Khalilzadeh authored and GitHub committed 2024-05-18 10:00:08 +03:30
1 parent 3a94abb649
commit 12c31865f7
15 files changed
+2731

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
const PORT = process.env.PORT || 5000;
const connectDbAndRunServer = async (app, db) => {
try {
await db.connect();
app.listen(PORT, () => {
console.log(`server started on port:${PORT}`);
});
} catch (error) {
console.log("Failed to connect to DB");
console.error(error);
}
};
module.exports = { connectDbAndRunServer };