[x] Create a folder for the bff-service in the same level as for other services in the repo.
[x] Create an express application in this folder, that listens for all requests and redirects those requests to the appropriate services based on variables provided by the .env file.
bff-service workflow example:
Call bff-service by the URL: {bff-service-url}/{recipient-service-name}?var1=someValue
Get recipientURL from the env variables using {recipient-service-name} as a key
Get request method (GET, POST, etc.)
Make a new request to the needed service using the appropriate method and recipientURL
bff-service should return the result of the recipient’s request
[x] If bff-service cannot find recipientURL by the {recipient-service-name}, return a 'Cannot process request’ error message with status 502.
[x] bff-service should return the same status code and error message that the recipient service returns to the bff-service in case of any error on the recipient service side.
[x] bff-service should work only with requests from the product-service and CART services.
Task Definition
Source: https://github.com/rolling-scopes-school/nodejs-aws-tasks/blob/main/task9-bff/task.md