Add experimental support for OpenSCAD libraries

I've been able to get a proof of concept of downloading a openscad
library when the docker image builds
https://twitter.com/IrevDev/status/1400785325509660678
Since its experimental atm I'll leave it with just the one for now.

I've also got a local dev working again for the cad lambdas.

Resolves #338
This commit is contained in:
Kurt Hutten
2021-06-05 11:11:14 +10:00
parent a2327b6169
commit b868ab292b
7 changed files with 1827 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ const invocationURL = (port) =>
app.post('/openscad/preview', async (req, res) => {
try {
const { data } = await axios.post(invocationURL(5052), {
body: Buffer.from(JSON.stringify(req.body)).toString('base64'),
body: JSON.stringify(req.body),
})
res.status(data.statusCode)
res.send(data.body)
@@ -26,7 +26,7 @@ app.post('/cadquery/stl', async (req, res) => {
console.log('making post request to 5060')
try {
const { data } = await axios.post(invocationURL(5060), {
body: Buffer.from(JSON.stringify(req.body)).toString('base64'),
body: req.body
})
res.status(data.statusCode)
res.send(data.body)