https://github.com/azrubael/230716-mongo-node
A simple Node.js application that connects to a containerized MongoDB DBMS.
https://github.com/azrubael/230716-mongo-node
Last synced: about 1 year ago
JSON representation
A simple Node.js application that connects to a containerized MongoDB DBMS.
- Host: GitHub
- URL: https://github.com/azrubael/230716-mongo-node
- Owner: Azrubael
- Created: 2023-07-16T09:55:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-17T09:55:33.000Z (almost 3 years ago)
- Last Synced: 2025-02-15T10:32:18.505Z (over 1 year ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A sample project with a simple Node.js application that connects to a containerized MongoDB DBMS.
* To start application:
[1] - create a '.env' file with credentials
```bash
$ cat .env
# node.js app's configuration
EXPRESS_PORT=8001
# mongodb app's configuration
MONGO_INITDB_HOST=localhost
MONGO_INITDB_ROOT_USERNAME=user
MONGO_INITDB_ROOT_PASSWORD=pass
MONGO_INITDB_PORT=27017
MONGO_INITDB_DATABASE=app
```
[2] - In the first bash terminal
```bash
$ docker compose up
```
[3] - In the second bash terminal
```bash
$ npm run start
```
* To correctly stop application do not forget
```bash
$ docker compose down
```