This is a Test API for a backend developer position.
$ git clone
$ yarn install
In this case, we are using docker-compose to run the database. You can run the following command to start the database:
$ docker-compose up -d
-
Note 1: If you don't have docker-compose installed, you can install it here.
-
Note 2: Postgres is running on port 5433. If you have another service running on this port, you can change the port in '.env' file.
-
Note 3: The '.env' file is in the root of the project. This file is used to set the environment variables. This file don't have to be commited to the repository, but for this test, it is commited.
# development and watch mode
$ yarn start:dev
To Populate the database, you can run the endpoints below in the following order:
> localhost:3000/categories/populate GET
> localhost:3000/products/populate GET
THis REST API has an API documentation. You can access it by running the app and accessing the following URL:
localhost:3000/api
> localhost:3000/products POST
This endpoint returns a product with it categories. It is possible to filter the categories by name and id. It's not case sensitive.
> localhost:3000/products?category=hogar GET