@heyhru/app-dms-server 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +10 -1
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -18,6 +18,10 @@ var config = {
18
18
  jwtExpiresIn: "24h",
19
19
  encryptionKey: process.env.ENCRYPTION_KEY || "dev-encryption-key-32-bytes-long!",
20
20
  dbUrl: process.env.DATABASE_URL,
21
+ dbSsl: process.env.DATABASE_SSL === "true",
22
+ dbPoolMin: Number(process.env.DATABASE_POOL_MIN) || 2,
23
+ dbPoolMax: Number(process.env.DATABASE_POOL_MAX) || 10,
24
+ dbIdleTimeoutMs: Number(process.env.DATABASE_IDLE_TIMEOUT) || 1e4,
21
25
  nodeEnv: process.env.NODE_ENV || "development"
22
26
  };
23
27
 
@@ -786,7 +790,12 @@ async function runMigrations() {
786
790
 
787
791
  // src/index.ts
788
792
  async function main() {
789
- await createPgDb(config.dbUrl);
793
+ await createPgDb(config.dbUrl, {
794
+ ssl: config.dbSsl,
795
+ poolMin: config.dbPoolMin,
796
+ poolMax: config.dbPoolMax,
797
+ idleTimeoutMs: config.dbIdleTimeoutMs
798
+ });
790
799
  await runMigrations();
791
800
  const app = await buildApp();
792
801
  await app.listen({ port: config.port, host: "0.0.0.0" });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.2.0",
6
+ "version": "0.3.0",
7
7
  "description": "DMS backend API server built on Fastify",
8
8
  "type": "module",
9
9
  "main": "./dist/index.mjs",
@@ -20,12 +20,12 @@
20
20
  "dependencies": {
21
21
  "@fastify/cookie": "^11.0.2",
22
22
  "@fastify/cors": "^11.0.0",
23
- "@heyhru/business-dms-user": "0.2.0",
24
- "@heyhru/common-util-logger": "0.2.0",
25
- "@heyhru/server-plugin-jwt": "0.2.0",
26
- "@heyhru/server-plugin-mysql": "0.2.0",
27
- "@heyhru/server-plugin-pg": "0.2.0",
28
- "@heyhru/server-util-crypto": "0.2.0",
23
+ "@heyhru/business-dms-user": "0.3.0",
24
+ "@heyhru/common-util-logger": "0.3.0",
25
+ "@heyhru/server-plugin-jwt": "0.3.0",
26
+ "@heyhru/server-plugin-mysql": "0.3.0",
27
+ "@heyhru/server-plugin-pg": "0.3.0",
28
+ "@heyhru/server-util-crypto": "0.3.0",
29
29
  "fastify": "^5.8.4",
30
30
  "node-sql-parser": "^5.4.0"
31
31
  },
@@ -37,5 +37,5 @@
37
37
  "typescript": "^6.0.2",
38
38
  "vitest": "^4.1.2"
39
39
  },
40
- "gitHead": "52867b97f908359000f3b690daf2229921dcfd9a"
40
+ "gitHead": "577a6d89e51ac836bf14d9e6d12eeb61d1b17939"
41
41
  }