Skip to content

Commit

Permalink
modified to add client connect error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaiyato committed Nov 24, 2023
1 parent 06c98f4 commit 0b620b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static("public"));

db.connect();
db.on('error', (err) => {
console.error('something bad has happened!', err.stack);
});

app.get("/", async (req, res) => {
var visited_countries = await get_visited_countries();
Expand Down

0 comments on commit 0b620b9

Please sign in to comment.