Rhino.Compute- Grasshopper Appserver POST Request Error

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?


Have you been able to look through the sample projects that are in the AppServer repo? Here’s one example of how they send a definition over to Rhino.Compute.

Thank you! I was able to get it to work using that example.
Believe the issue was that I had to run both the Rhino Compute and the App Server at the same time.

Yes, both the Rhino.Compute server and the App Server must be running at the same time in order for it to work correctly.