This project is an API developed with NestJS that connects to a MongoDB database to manage clients.
Clone this repository to your local machine:
git clone https://github.com/eldalo/apex-client
cd apex-client
$ npm install
Create a .env file in the root of the project with the following configuration to connect to MongoDB:
Variable Name | Default Value | Required |
---|---|---|
MONGODB_USERNAME |
apex_user |
Yes |
MONGODB_PASSWORD |
abc123qwerty |
Yes |
MONGODB_DATABASE |
db_apex |
Yes |
$ docker compose up -d && docker compose start
use db_apex
db.createUser({ user: "apex_user", pwd: "abc123qwerty", roles: [ { role: "readWrite", db: "db_apex" } ]})
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
The API will be available at http://localhost:3000.
- Path:
/clients
- Method: GET
- Description: Retrieves a list of clients.
- Path:
/clients/:id
- Method: GET
- Description: Retrieves the details of a specific client by its ID.