diff --git a/Dockerfile b/Dockerfile index 7192d33..f330878 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/prisma/praktika.db b/prisma/praktika.db index 0c22272..b53b369 100644 Binary files a/prisma/praktika.db and b/prisma/praktika.db differ diff --git a/server.js b/server.js new file mode 100644 index 0000000..4052083 --- /dev/null +++ b/server.js @@ -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'); +}); diff --git a/src/hooks.server.ts b/src/hooks.server.ts new file mode 100644 index 0000000..543bcbe --- /dev/null +++ b/src/hooks.server.ts @@ -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 + }); + } +); diff --git a/static/uploads/7ff1a256-8df4-4c6c-9713-e3196044fed5.pdf b/static/uploads/7ff1a256-8df4-4c6c-9713-e3196044fed5.pdf new file mode 100644 index 0000000..473a9ab Binary files /dev/null and b/static/uploads/7ff1a256-8df4-4c6c-9713-e3196044fed5.pdf differ diff --git a/static/uploads/de2af874-f362-4172-b916-e6bf0e2cca2d.pdf b/static/uploads/de2af874-f362-4172-b916-e6bf0e2cca2d.pdf new file mode 100644 index 0000000..bc98c4a Binary files /dev/null and b/static/uploads/de2af874-f362-4172-b916-e6bf0e2cca2d.pdf differ diff --git a/svelte.config.js b/svelte.config.js index 76a58b1..e0a641e 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -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;