OpenSCAD and CadQuery working together in dev
Still clean up of the backend/lamdas, and there's a conda permission issue when deploying the Cadquery image
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
let openScadBaseURL = process.env.CADQUERY_BASE_URL
|
||||
import { lambdaBaseURL } from './common'
|
||||
|
||||
export const render = async ({ code }) => {
|
||||
const body = JSON.stringify({
|
||||
@@ -6,7 +6,7 @@ export const render = async ({ code }) => {
|
||||
file: code,
|
||||
})
|
||||
try {
|
||||
const response = await fetch(openScadBaseURL, {
|
||||
const response = await fetch(lambdaBaseURL + '/cadquery/stl', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
3
web/src/helpers/cadPackages/common.js
Normal file
3
web/src/helpers/cadPackages/common.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export const lambdaBaseURL =
|
||||
process.env.CAD_LAMBDA_BASE_URL ||
|
||||
'https://t7wdlz8ztf.execute-api.us-east-1.amazonaws.com/dev2'
|
||||
@@ -1,6 +1,4 @@
|
||||
let openScadBaseURL =
|
||||
process.env.OPENSCAD_BASE_URL ||
|
||||
'https://x2wvhihk56.execute-api.us-east-1.amazonaws.com/dev'
|
||||
import { lambdaBaseURL } from './common'
|
||||
|
||||
export const render = async ({ code, settings }) => {
|
||||
const pixelRatio = window.devicePixelRatio || 1
|
||||
@@ -16,7 +14,7 @@ export const render = async ({ code, settings }) => {
|
||||
file: code,
|
||||
})
|
||||
try {
|
||||
const response = await fetch(openScadBaseURL + '/render', {
|
||||
const response = await fetch(lambdaBaseURL + '/openscad/preview', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user