Move API Call from jQuery to the Back End
I currently have a jQuery ajax call to a third-party API, which checks a vehicle's licence plate against a national database:
$.ajax({
type: "get",
url: "https://test.carjam.co.nz/a/vehicle:abcd",
data: {key:key,plate:plate},
dataType: "json",
success: function(res){
// display message validating license plate and save response data into database
}
// other code
}); However, the third party now requires the call to be from the "back end", as any attempts to use browser code such as JS or juery will result in a "cross-origin" related error.
What would be the most effective way to bring this into the back-end? Via a cfc?
They also give the option of using node.js, which I know nothing about.
