Project Start
2020.12.09 1500
Received code challenge files.
Setup project on github.
Setup folder structure.
[✔] First task - make sure I have access to the APIs
Note: Important Do not maintain api secrets in the git repo
2020.12.09 1700 Got my first problem solved! I can access all the required APIs. Here is the first-cut for the curl tests.
#!make
# Makefile
# Make sure the have proper accesses to the APIs.
test_apis_fw_movies:
@echo "\nTesting Filmworld APIs\n"
source $(env_conf_dir)/$(api_conf) && \
curl -s -i -X GET -H "x-api-key: $$API_KEY" $(API_FW_MOVIES)
test_apis_fw_movie_id:
@echo "\nTesting Filmworld APIs\n"
source $(env_conf_dir)/$(api_conf) && \
curl -s -i -X GET -H "x-api-key: $$API_KEY" $(API_FW_MOVIE_ID)
test_apis_cw_movies:
@echo "\nTesting Cinemaworld APIs\n"
source $(env_conf_dir)/$(api_conf) && \
curl -s -i -X GET -H "x-api-key: $$API_KEY" $(API_CW_MOVIES)
test_apis_cw_movie_id:
@echo "\nTesting Cinemaworld APIs\n"
source $(env_conf_dir)/$(api_conf) && \
curl -s -i -X GET -H "x-api-key: $$API_KEY" $(API_CW_MOVIE_ID)
test_apis: test_apis_cw_movies test_apis_cw_movie_id test_apis_fw_movies test_apis_fw_movie_id
I trimmed the above duplicates to just this:
test_all_apis:
source $(env_conf_dir)/$(api_conf) && \
$(foreach api, $(API_ALL), \
curl -s -i -X GET -H "x-api-key: $$API_KEY" $(api))
See the Makefile
for complete code.
–out. Peace