The problem statement is to create a couple of endpoints. The structure of request response has been shared with the user.
Checks whether the service is available.
- Code: 200
- Content:
Hello world!
Adds two given numbers
Content-Type: application/json
{
first: number,
second: number
}
- Status code: 200
- Content:
{ result: result-of-the-summation }
Subtracts two given numbers
Content-Type: application/json
{
first: number,
second: number
}
- Status code: 200
- Content:
{ result: result-of-the-subtraction }
In order to submit a solution, follow these steps.
- Fork the API-Validation repository (How to fork a repository github)
- Deselect the "Copy the main branch only" to copy other language demos as well
- Clone the forked repository (How to clone a repository github)
- Change the branch according to the language of your choice (This demo is available in (language-> branch) "node" -> "Node", "python" -> "Python" ) (How to change branches git )
- Enable workflows in your github fork (Under the actions tab -> Select "I understand my workflows, go ahead and enable them" to enable the test workflow)
- Use your favourite editor to make changes
- Create a commit after testing it locally (How to commit git)
- Push the commit to the remote to the same branch (github repo) (How to push git)
- If all your changes work well, you will see a green tick on the actions section on your repo under the selected branch (How to see last run action)
- If it's a cross mark, the logs will tell you what you did wrong.
- Fix the issue, and repeat steps 4+ to resubmit
- Congratulations, you have successfully solved the problem
Repo -> Settings -> Security -> Secrets and variables -> Actions -> New repository secret ->
Name = "COLLECTIONID"
Secret = "<collectionID>"
Name = "POSTMANAPIKEY"
Secret = "<apikey>"
Name = "MAIL_USERNAME"
Secret = "<username>"
Name = "MAIL_PASSWORD"
Secret = "<password>"
Name = "SENDER_MAIL"
Secret = "<emailID>"