maksumov / rss-shop-be

3 stars 0 forks source link

Task 9 Solution #14

Open maksumov opened 3 years ago

maksumov commented 3 years ago

Task 9 Definition

Task defined at https://github.com/rolling-scopes-school/nodejs-aws-tasks/blob/main/task9-bff/task.md

Task 9.1

How to test Task 9.1.

Clone repo & install dependencies with following commands:

git clone https://github.com/maksumov/rss-shop-be.git
cd rss-shop-be
git fetch origin pull/14/head:task-9
git checkout task-9
cd src/bff-service
npm install

After installing dependencies you should create .env file in the root folder of bff-service (see .env.sample for example of configuration or just rename this file to .env file).

And finally you need to compile TypeScript files by running tsc and then you can run service by npm run start:dev.

This PR closes #12

Task 9.2

This PR closes #13

Additional Tasks

Add Cache

How to test caching

How to test caching (alternative method)

This PR closes #15

NestJS implementation

Working on closing the task #16

Self-check

Main tasks score: 5/5 Additional tasks score: 1/2 Total expected score: 6/7

Data for Task Evaluation

URLs

aleksei-bulgak-study commented 3 years ago

For case when url contains only service name and query params application responds with

изображение
maksumov commented 3 years ago

For case when url contains only service name and query params application responds with

изображение

This is because the BFF app can't find a service matching the name products?test=test. The name of the service to be proxied is defined by the application via a split by a character /. You might as well expect to get a result by making a request to http://maksumov-bff-api-dev.eu-west-1.elasticbeanstalk.com/products-test=test endpoint

aleksei-bulgak-study commented 3 years ago

For case when url contains only service name and query params application responds with

изображение

This is because the BFF app can't find a service matching the name products?test=test. The name of the service to be proxied is defined by the application via a split by a character /. You might as well expect to get a result by making a request to http://maksumov-bff-api-dev.eu-west-1.elasticbeanstalk.com/products-test=test endpoint

but url is valid. In my opinion result url sould be smth like https://productUrl?test=test

maksumov commented 3 years ago

but url is valid. In my opinion result url sould be smth like https://productUrl?test=test

Url is not valid for BFF. If you want to call products service - you should send request to http://maksumov-bff-api-dev.eu-west-1.elasticbeanstalk.com/products/?test=test endpoint

aleksei-bulgak-study commented 3 years ago

Here is example from task description {bff-service-url}/{recipient-service-name}?var1=someValue and it also has query parameter without any tailing slashes after service name

maksumov commented 3 years ago

I changed the app and deployed a new version