BeamIO-Inc / algorithm_toolkit

This project provides an easy way for researchers and developers to develop and share algorithms related to geospatial data and imagery.
https://algorithm-toolkit.readthedocs.io/en/latest/index.html
MIT License
6 stars 4 forks source link

Feature/dynamic chain endpoint #22

Closed wrp5031 closed 3 years ago

wrp5031 commented 3 years ago

What?

When performing a POST request to run a chain, the endpoint now contains the chain name. The chain is no longer needed in the request form. The old route /main/, which requires the chain name in the request form, still exists, but has been deprecated. A utility function was also added.

Issue #21

Why?

To reduce the number of parameters in the request form, and to reduce the amount of code in home.py

How?

Created a new route /api/<chain_name> which fires off a nearly identical function that /main/ did. Also edited the test_run template so that it submits a POST request to the new /api/<chain_name> instead of /main/. A utility function was also create and used in both route functions, which performs some basic checking logic of the request form.

Testing?

Postman was used in order to test the deprecated /main/ endpoint as well as the new /api/<chain_name> endpoint