Skip to content

Commit

Permalink
Merge pull request #3 from GusEngers/main
Browse files Browse the repository at this point in the history
Pre-Production
  • Loading branch information
GusEngers committed Sep 7, 2023
2 parents 22e85ef + 79d1e5a commit 254937f
Show file tree
Hide file tree
Showing 40 changed files with 2,459 additions and 263 deletions.
21 changes: 11 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
const app = require('./src/app');
const { db } = require('./src/db');
const db = require('./src/db');
require('dotenv').config();

db.connect()
.then(() => {
async function main() {
try {
await db();
app.listen(process.env.PORT, () => {
console.log(
`Server listen on port: ${process.env.PORT} and database connected!`
);
console.log('Server listening on port:', process.env.PORT);
});
})
.catch((err) => {
console.error('Database not connected:', err);
});
} catch (error) {
console.error('Error starting server:', error);
}
}

main();
Loading

0 comments on commit 254937f

Please sign in to comment.