BODY_SIZE_LIMIT erstellt
This commit is contained in:
@@ -15,5 +15,5 @@ FROM node:23.11-alpine3.20
|
||||
COPY --from=build /app .
|
||||
ENV HOST=0.0.0.0
|
||||
EXPOSE 3000
|
||||
CMD ["sh", "-c", "ORIGIN=https://praktikum.innovation-hub-niedersachsen.de node build/index.js"]
|
||||
CMD ["sh", "-c", "BODY_SIZE_LIMIT=500M ORIGIN=https://praktikum.innovation-hub-niedersachsen.de node build/index.js"]
|
||||
|
||||
|
||||
Binary file not shown.
16
server.js
Normal file
16
server.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { createServer } from 'http';
|
||||
import { handler } from './build/index.js';
|
||||
|
||||
const server = createServer((req, res) => {
|
||||
if (req.headers['content-length'] > 50 * 1024 * 1024) { // 50 MB
|
||||
res.statusCode = 413; // Payload Too Large
|
||||
res.end('Payload Too Large');
|
||||
return;
|
||||
}
|
||||
|
||||
handler(req, res);
|
||||
});
|
||||
|
||||
server.listen(3000, () => {
|
||||
console.log('Server läuft auf Port 3000');
|
||||
});
|
||||
11
src/hooks.server.ts
Normal file
11
src/hooks.server.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { sequence } from '@sveltejs/kit/hooks';
|
||||
import { json } from '@sveltejs/kit';
|
||||
|
||||
export const handle = sequence(
|
||||
async ({ event, resolve }) => {
|
||||
return resolve(event, {
|
||||
// Erhöhe das Limit hier (z. B. auf 1 GB = 20 * 1024 * 1024)
|
||||
maxBodySize: 1024 * 1024 * 1024
|
||||
});
|
||||
}
|
||||
);
|
||||
BIN
static/uploads/7ff1a256-8df4-4c6c-9713-e3196044fed5.pdf
Normal file
BIN
static/uploads/7ff1a256-8df4-4c6c-9713-e3196044fed5.pdf
Normal file
Binary file not shown.
BIN
static/uploads/de2af874-f362-4172-b916-e6bf0e2cca2d.pdf
Normal file
BIN
static/uploads/de2af874-f362-4172-b916-e6bf0e2cca2d.pdf
Normal file
Binary file not shown.
@@ -11,14 +11,8 @@ const config = {
|
||||
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
||||
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
||||
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
||||
adapter: adapter(),
|
||||
},
|
||||
vite: {
|
||||
server: {
|
||||
maxPayload: 2048 * 1024 * 1024 // 2 GB, adjust as needed
|
||||
}
|
||||
}
|
||||
|
||||
adapter: adapter()
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user