I've been using OpenJSCAD (demo at http://openjscad.org/) for small parts and really like it. With some work it could probably do what you describe but as far as I can tell no one is using it that way.
It would be cool if there was an ecosystem of OpenJSCAD parts that you could import as javascript modules.
I built the URL part out into a little side project. It uses OpenJSCAD but only the OpenSCAD interpreter so it can render the STL for you on the server.
Why are people downvoting this? It seems like a perfectly reasonable wish. If something like this already exists then then please share it. The replies so farention things that are similar in some ways but either aren't parametric or don't have the extensibility that @iamleppert is lining for.
If you are referring to SolveSpace, OpenSCAD is text-based, and you build your geometry programmatically.
SolveSpace has a CAD viewer interface, and you draw and constrain your geometry.
I use FreeCAD as an alternative to AutoCAD (Inventor, Fusion360), but I have used SolveSpace for a small project where I wanted to animate the linkage for a client. The same could have been done in Fusion360 too. It was for fun.
The latest FreeCAD has greatly improved animation capabilities for renderings.
You can use SolveSpace's constraint solver in your own project, since I believe, it is separate from the viewer code. It is a very nice piece of work by one individual. I follow it once or twice a year to see if people are going to add much more to it.
[1] https://github.com/whitequark/solvespace