From 54ce901169cd2b318efab3a557b6b9703b45ee01 Mon Sep 17 00:00:00 2001 From: sofiesty Date: Fri, 9 Oct 2026 11:37:58 +0200 Subject: [PATCH] feature/deploy oppsett --- backend/package-lock.json | 8 +++---- backend/package.json | 7 +++--- backend/src/db.ts | 2 +- backend/src/index.ts | 2 +- backend/tsconfig.json | 47 ++++++++------------------------------- 5 files changed, 19 insertions(+), 47 deletions(-) diff --git a/backend/package-lock.json b/backend/package-lock.json index 75f0f39..1e0229a 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@apollo/server": "^5.5.1", "csv-parse": "^7.0.3", - "dotenv": "^18.0.5", + "dotenv": "^18.0.6", "graphql": "^16.14.2", "pg": "^8.23.1" }, @@ -1409,9 +1409,9 @@ } }, "node_modules/dotenv": { - "version": "18.0.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.5.tgz", - "integrity": "sha512-aBrGvt6KhjxbEnatqMWOMidftwsrCiCvqh1yNIGB9QyF0J+VcWkKDMsvYOEm7ZS82oiV+BT1sTOtIlAmUlTpwQ==", + "version": "18.0.6", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.6.tgz", + "integrity": "sha512-ZMVmohV6CvAJtj++pZNyggluUt6hbRdQAxc2+Z635RL6/AG/ruXv5lHnybUFoxMPL/yrTL/tsF4paZu2l7RA6Q==", "license": "BSD-2-Clause", "bin": { "dotenv": "dist/index.cjs" diff --git a/backend/package.json b/backend/package.json index 20d2eff..1abc594 100644 --- a/backend/package.json +++ b/backend/package.json @@ -3,19 +3,20 @@ "version": "1.0.0", "description": "", "main": "index.js", + "type": "module", "scripts": { "dev": "tsx watch src/index.ts", - "start": "tsx src/index.ts", + "build": "tsc", + "start": "node dist/index.js", "import": "tsx scripts/import.ts" }, "keywords": [], "author": "", "license": "ISC", - "type": "module", "dependencies": { "@apollo/server": "^5.5.1", "csv-parse": "^7.0.3", - "dotenv": "^18.0.5", + "dotenv": "^18.0.6", "graphql": "^16.14.2", "pg": "^8.23.1" }, diff --git a/backend/src/db.ts b/backend/src/db.ts index 26c0925..46ab7b4 100644 --- a/backend/src/db.ts +++ b/backend/src/db.ts @@ -5,7 +5,7 @@ const { Pool } = pg; export const pool = new Pool({ host: process.env.DB_HOST, - port: Number(process.env.DB_PORT), + port: Number(process.env.DB_PORT ?? 5432), database: process.env.DB_NAME, user: process.env.DB_USER, password: process.env.DB_PASSWORD, diff --git a/backend/src/index.ts b/backend/src/index.ts index 8326f5d..dbbc058 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -246,7 +246,7 @@ const server = new ApolloServer({ }); const { url } = await startStandaloneServer(server, { - listen: { port: 3001 }, + listen: { port: Number(process.env.PORT ?? 3001) }, }); console.log(`GraphQL server running at ${url}`); \ No newline at end of file diff --git a/backend/tsconfig.json b/backend/tsconfig.json index cec4a3a..aacaa39 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -1,44 +1,15 @@ { - // Visit https://aka.ms/tsconfig to read more about this file "compilerOptions": { - // File Layout - // "rootDir": "./src", - // "outDir": "./dist", - - // Environment Settings - // See also https://aka.ms/tsconfig/module + "target": "es2022", "module": "nodenext", - "target": "esnext", - "types": [], - // For nodejs: - // "lib": ["esnext"], - // "types": ["node"], - // and npm install -D @types/node - - // Other Outputs - "sourceMap": true, - "declaration": true, - "declarationMap": true, - - // Stricter Typechecking Options - "noUncheckedIndexedAccess": true, - "exactOptionalPropertyTypes": true, - - // Style Options - // "noImplicitReturns": true, - // "noImplicitOverride": true, - // "noUnusedLocals": true, - // "noUnusedParameters": true, - // "noFallthroughCasesInSwitch": true, - // "noPropertyAccessFromIndexSignature": true, - - // Recommended Options + "moduleResolution": "nodenext", + "rootDir": "src", + "outDir": "dist", "strict": true, - "jsx": "react-jsx", - "verbatimModuleSyntax": true, - "isolatedModules": true, - "noUncheckedSideEffectImports": true, - "moduleDetection": "force", + "esModuleInterop": true, "skipLibCheck": true, - } + "noEmitOnError": true, + "types": ["node"] + }, + "include": ["src"] }