A new company needs to address these requirements:
- Create a Node API with Typescript.
- Connect the Node API to MongoDB using mongoose (desirable models in typescript).
- We need to develop three endpoints behind a basic authentication (username and password).
- Create a user with name, last name, address, and profile picture (this should be a file).
- Retrieve users.
- Update user.
$ npm install
docker-compose up -d mongodb
export MONGO_URI=mongodb://user:pass1234@localhost:27017/node_challenge?authSource=admin
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# Running it using docker
$ docker-compose up -d
# Seed the database
$ npm run test:seed
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
- Run the seeds in the local environment
- Run the application
- Open the following url in the browser http://localhost:3000/docs
- Press Authorize button and introduce the following information
- user: user1
- password: password
- Test the endpoints!