roipoussiere / cadquery-server

A web server used to render 3d models from CadQuery code loaded dynamically.
MIT License
54 stars 17 forks source link

New API #54

Open roipoussiere opened 2 years ago

roipoussiere commented 2 years ago

/api/sandbox

/api/models/

dcowden commented 2 years ago

on /api/sandbox, here are a few suggestions:

  1. i think a name that more clearly indicates that this script is going to be executed would make ense, such as 'exec' or 'build'
  2. it still might be nice to supply parameters and values. I think /api/sandbox is essentially an 'anonymous/unnamed' model, so i would expect it to be nearly the same as /api/model

Since a model is a resource on the server, you might consider nesting execute as an endpoint underneath the model like:

 /<model_name

In this example, /model_name should return the model resource itself ( file name/date, source code, named parameters, perhaps links to results of prior executions, and /exec would run a new build

If this api is designed for programmatic clients, I think format is better requested using Content-type header, not a uri parameter.