This is an HTTP API and web server that wraps the freerouting autorouter.
npm install -g freerouting-http
The web interface is a simple form that allows you to create an autorouting job and view its progress.
TODO
- All endpoints accept
POSTrequests */getendpoints acceptGETorPOST- All endpoints return JSON
| Endpoint | Description |
|---|---|
/autorouting_jobs/create |
Create a new autorouting job. |
/autorouting_jobs/get |
Get the autorouting job progress, output and result |
Create a new autorouting job. Takes an input_dsn in the Specctra DSN format.
Returns an autorouting_job object, use autorouting_job.autorouting_job_id
to track the job progress.
POST Request Body:
{
"input_dsn": "(PCB "untitled.brd"\n(parser..."
}Response body:
{
"autorouting_job_id": "1",
"display_status": "Autorouting",
"is_running": true,
"has_error": false,
"was_successful": false,
// Path to input file, uses FREEROUTING_HTTP_BASE_URL
"input_dsn_url": "http://localhost:3000/files/ece12a7c.dsn",
// Populated when successful
"output_dsn_url": null
}Get all the information associated with an existing autorouting job. You can
use GET or POST
Example call:
curl http://localhost:3000/autorouting_jobs/get?autorouting_job_id=1Response body after job completes:
{
"autorouting_job_id": "1",
"display_status": "Autorouting",
"is_running": false,
"has_error": false,
"was_successful": true,
"input_dsn_url": "http://localhost:3000/files/ece12a7c.dsn",
"output_dsn_url": "http://localhost:3000/files/k9f9911c.dsn"
}Response body after job failure:
{
"autorouting_job_id": "1",
"display_status": "Autorouting",
"is_running": false,
"has_error": true,
"was_successful": false,
"input_dsn_url": "http://localhost:3000/files/ece12a7c.dsn",
"output_dsn_url": null,
"error": {
"error_code": "invalid_dsn",
"message": "DSN file could not be parsed"
}
}TODO