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
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