Increase upload payload limits to 500MB to fix 413 error

This commit is contained in:
AI Bot
2026-07-30 16:45:04 +05:30
parent c4f27f701a
commit 5e5262c0b8
3 changed files with 24 additions and 1 deletions
+2 -1
View File
@@ -11,7 +11,8 @@ const { db, run, get, all } = require('./database');
const app = express();
app.use(cors());
app.use(express.json({ limit: '100mb' }));
app.use(express.json({ limit: '500mb' }));
app.use(express.urlencoded({ limit: '500mb', extended: true }));
const JWT_SECRET = 'viz-3d-local-secret-key-1234';
+1
View File
@@ -1,6 +1,7 @@
server {
listen 80;
server_name localhost;
client_max_body_size 500M;
# Serve static assets
location / {
+21
View File
@@ -1371,6 +1371,13 @@ export default function Editor() {
const material = Array.isArray(child.material) ? child.material[0] : child.material;
const mProps = { ...globalMaterialProps };
const extractTextureUrl = (texture: any) => {
if (!texture) return undefined;
if (texture.image && typeof texture.image.src === 'string') return texture.image.src;
if (texture.source && texture.source.data && typeof texture.source.data.src === 'string') return texture.source.data.src;
return undefined;
};
if (material) {
if (material.color) mProps.color = `#${material.color.getHexString()}`;
if (material.roughness !== undefined) mProps.roughness = material.roughness;
@@ -1385,6 +1392,20 @@ export default function Editor() {
if (m.clearcoat !== undefined) mProps.clearcoat = m.clearcoat;
if (m.sheen !== undefined) mProps.sheen = m.sheen;
if (m.specularIntensity !== undefined) mProps.specularIntensity = m.specularIntensity;
// Extract textures
if (m.map) mProps.map = extractTextureUrl(m.map);
if (m.normalMap) mProps.normalMap = extractTextureUrl(m.normalMap);
if (m.roughnessMap) mProps.roughnessMap = extractTextureUrl(m.roughnessMap);
if (m.metalnessMap) mProps.metalnessMap = extractTextureUrl(m.metalnessMap);
if (m.alphaMap) mProps.alphaMap = extractTextureUrl(m.alphaMap);
// Extract UV properties from the main map if available
if (m.map) {
if (m.map.repeat) mProps.uvTiling = [m.map.repeat.x, m.map.repeat.y];
if (m.map.offset) mProps.uvOffset = [m.map.offset.x, m.map.offset.y];
if (m.map.rotation !== undefined) mProps.uvRotation = m.map.rotation * (180 / Math.PI);
}
}
newSceneObjects.push({