Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovicm67 committed Sep 21, 2023
1 parent e1f0846 commit 950fa4a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# MongoDB check and notify on Slack

This app periodically checks the state of a MongoDB instance (ping) and notify on Slack when the state is changing.
It also provides an HTTP endpoint where we can query to see the current state and the last time the state was updated and the date of the last check.

## Configuration

This application can be configured using the following environment variables:

- `MONGODB_URI`: A complete MongoDB URI that will be used to check the state of the MongoDB instance (default: `"mongodb://localhost:27017"`)
- `VERBOSE_MODE`: The verbose mode, if set to `"true"`, will print the result of each check in the logs (default: `"false"`)
- `SHOW_ERRORS`: If set to `"true"`; it will display more details to the error in the logs (default: `"true"`)
- `PING_INTERVAL`: The interval of time in milliseconds where the ping to the MongoDB instance is done (default: `"1000"`)
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const pingServer = async () => {
}
};

// Ping the server every `pingInterval` miliseconds
// Ping the server every `pingInterval` milliseconds
setInterval(async () => {
await pingServer();
}, pingInterval);
Expand Down

0 comments on commit 950fa4a

Please sign in to comment.