Using case: How to get Medical ID from the front end (VueJS) to back end (Go) — Part 1
Code-level example for the real project (Open source cervical AI)
- We saw this error when running open cervical AI:
- We locate the err in VSC:
- Then we know it is used by the following code :
In the above code, CreateDataset() is a call in Gin framework.
- Then we can see how Gin route this call by what URI path:
It is “/createdataset”. Now we know, when the backend receives a “Post /createdataset”, it will call all the way down to the func called “Createdataset” in c_datasets.go
Now, lets move to the frontend to locate who send the request “Post /createdataset”:
- Searching createdataset:
In step3-train.vue, this STF, it was called by createdataset, Please note: here is javascript code now, it is not Go anymore, even the function name is the same.
- Next step, we found createdataset is coming from /api/cervical
- Go inside of cervcal.js we found the following code:
So till now, we have complete the analysis of a call from the frontend to the backend.
In Part 2, we will be seeing how the data in a context will be defined and send through the above call.