Hello everyone,
I am encountering issues communicating with Rhino.Compute via JavaScript. I cloned the repository from Rhino Compute Development Guide and compiled it in Visual Studio. After getting it up and running, I tested an endpoint with http://localhost:6500/healthcheck without any issues. However, when I try to POST a Grasshopper file to Rhino.Compute, I receive a 500 error.. I have tried changing the file path ../designs/hops_test.gh
in various ways, but without success.
Below is our method to fetch data from Rhino Compute
const response = await fetch(‘http://localhost:6500/grasshopper’, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’
},
body: JSON.stringify({
definition: ‘../designs/hops_test.gh’,
inputs: {
getInteger1: 45,
getInteger2: 63
}
})
});
const data = await response.json();
// Process and display data
displayRhinoModel(data);
});
What’s the correct path format for the definition? Is there any sample POST code using fetch or compute.rhino3d.js? Could this be a server config issue?