Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 648 Bytes

clientcode.md

File metadata and controls

34 lines (25 loc) · 648 Bytes

Client code

Please review the example code we include in this repository.

To solve a GH definition you need to pass the definition name and input values to the appserver:

// set the input values:
let data = {}
data.definition = 'BranchNodeRnd.gh'
data.inputs = {
  'Count': 10,
  'Radius': 5,
  'Length': 3
}

// call appserver
compute()

async function compute(){
  
  const request = {
    'method':'POST',
    'body': JSON.stringify(data),
    'headers': {'Content-Type': 'application/json'}
  }

  const url = 'https://{your-compute-appserver}/solve'

  let response = await fetch(url, request)

  //...//
}