It allows users to register, log into, upload photos and filter an image from public URL.
The project repository can be downloaded from Github:
- The Image Filtering Microservice It is a Node-Express application which runs a simple script to filter the public images.
You'll need to create a new node server. Open a new terminal within the project directory and run:
- Initialize a new project:
npm i - run the development server with
npm run dev
I have included a Postman config file with the RestAPI endpoints to launch several integrated tests.
The steps to start the Image Filter Starter Code feature test are as follows:
- Open the Postman app and import this file integrated-testing-restapi.postman_collection.json (you can see it in the root of the project).
- You must registry any user. Select this POST: integrated-testing-restapi/Public/api/v0/user/auth valid registration. Go to the Body section and write this json with your email and password. For example:
{
"email":"test@mail.com",
"password":"test123"
}- In the Headers section you can add this row:
{
KEY = Content-Type,
VALUE = application/json
}
-
Click on Send button and the response should be '201 Created'.
-
Copy the token string (from json response)
Note: you can skip these 5 steps if you use the token shown at the bottom of this document.
-
Select this GET: integrated-testing-restapi/Authorized/api/v0/feed/filteredimage authorized.
-
Go to the Authorization section and select Type = Bearer Token. Finally, paste the token that you received in the previous request.
-
In the Params section you must add a new row with the public URL:
{
KEY = image_url,
VALUE = your_image_to_apply_the_filter
}
- Below I show a list with several public links that can be used for testing:
- https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg
- https://www.cleverfiles.com/howto/wp-content/uploads/2018/03/minion.jpg
- http://www.personal.psu.edu/jyc5774/jpg.jpg
- Finally you can see the response 200 OK and the image from URL will be displayed in the Postman response (with greyscale).
You must use the same file integrated-testing-restapi.postman_collection.json from Postman to start the tests.
-
Open the collection menu on '...' button and select the Edit option.
-
In the Variables section you can change the CURRENT VALUE by this AWS URL override-with-instance-elastic-beanstalk where the application has been deployed.
Note: click on Persist All to apply all changes.
-
Implement the same test plan as in the previous section Testing in Dev environment
Follow the process described in the course to eb init a new application and eb create a new environment to deploy your image-filter service! Don't forget you can use eb deploy to push changes.
All request of the course is working successfully.
NOT IMPLEMENTED