-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from GusEngers/main
Pre-Production
- Loading branch information
Showing
40 changed files
with
2,459 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Oops, something went wrong.