Remove s3
but also upgrade the cad lamdbas to use built javascript files, allowing us to use typescript, and patching redwood
This commit is contained in:
@@ -57,27 +57,18 @@ export const render = async ({ code, settings }: RenderArgs) => {
|
||||
if (response.status === 502) {
|
||||
return createUnhealthyResponse(new Date(), timeoutErrorMessage)
|
||||
}
|
||||
const data = await response.json()
|
||||
const type = data.type !== 'stl' ? 'png' : 'geometry'
|
||||
const newData = await fetch(data.url).then(async (a) => {
|
||||
const blob = await a.blob()
|
||||
const text = await new Response(blob).text()
|
||||
const { consoleMessage, customizerParams } = splitGziped(text)
|
||||
return {
|
||||
data:
|
||||
data.type !== 'stl'
|
||||
? blob
|
||||
: await stlToGeometry(window.URL.createObjectURL(blob)),
|
||||
consoleMessage,
|
||||
customizerParams,
|
||||
}
|
||||
})
|
||||
const blob = await response.blob()
|
||||
const text = await new Response(blob).text()
|
||||
const { consoleMessage, customizerParams, type } = splitGziped(text)
|
||||
return createHealthyResponse({
|
||||
type,
|
||||
data: newData.data,
|
||||
consoleMessage: newData.consoleMessage,
|
||||
type: type !== 'stl' ? 'png' : 'geometry',
|
||||
data:
|
||||
type !== 'stl'
|
||||
? blob
|
||||
: await stlToGeometry(window.URL.createObjectURL(blob)),
|
||||
consoleMessage,
|
||||
date: new Date(),
|
||||
customizerParams: openScadToCadhubParams(newData.customizerParams || []),
|
||||
customizerParams: openScadToCadhubParams(customizerParams || []),
|
||||
})
|
||||
} catch (e) {
|
||||
return createUnhealthyResponse(new Date())
|
||||
@@ -105,23 +96,18 @@ export const stl = async ({ code, settings }: RenderArgs) => {
|
||||
if (response.status === 502) {
|
||||
return createUnhealthyResponse(new Date(), timeoutErrorMessage)
|
||||
}
|
||||
const data = await response.json()
|
||||
const newData = await fetch(data.url).then(async (a) => {
|
||||
const blob = await a.blob()
|
||||
const text = await new Response(blob).text()
|
||||
const { consoleMessage, customizerParams } = splitGziped(text)
|
||||
return {
|
||||
data: await stlToGeometry(window.URL.createObjectURL(blob)),
|
||||
consoleMessage,
|
||||
customizerParams,
|
||||
}
|
||||
})
|
||||
const blob = await response.blob()
|
||||
const text = await new Response(blob).text()
|
||||
const { consoleMessage, customizerParams, type } = splitGziped(text)
|
||||
return createHealthyResponse({
|
||||
type: 'geometry',
|
||||
data: newData.data,
|
||||
consoleMessage: newData.consoleMessage,
|
||||
type: type !== 'stl' ? 'png' : 'geometry',
|
||||
data:
|
||||
type !== 'stl'
|
||||
? blob
|
||||
: await stlToGeometry(window.URL.createObjectURL(blob)),
|
||||
consoleMessage,
|
||||
date: new Date(),
|
||||
customizerParams: openScadToCadhubParams(newData.customizerParams || []),
|
||||
customizerParams: openScadToCadhubParams(customizerParams || []),
|
||||
})
|
||||
} catch (e) {
|
||||
return createUnhealthyResponse(new Date())
|
||||
|
||||
Reference in New Issue
Block a user