Movies REST API
- Build a REST API to show movie directors
Here's the Postman Collection
- Typescript
- Node.js (Express)
- MongoDB
- Docker
- NPM
- Clone the repository
$ git clone https://github.com/morelmiles/backend-task
- Install the dependencies
$ npm install
- Create a database (I use Docker on local machine)
$ docker pull mongo # Pull the mongo image from Docker Hub
$ docker run --name some-name -d mongo:tag # Create a container
$ docker exec -it some-name sh # Terminal for the mongo container
$ root@3fdfdadd6690:/# mongosh # Launch mongo's shell
$ test> use boilerplate # Create a database named boilerplate
$ boilerplate # Database created succesfully
- Copy the
env
variables and fill in the details
$ cp .env.example .env
- Start the
dev
server
$ npm run dev
- Use a separate database for running tests
- Mock the database connection using
mongodb-memory-server
- Add deployment scripts using Docker and docker-compose