@heyhru/app-dms-server 0.2.0 → 0.3.1
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.
- package/dist/index.js +11 -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
|
|
|
@@ -696,7 +700,7 @@ CREATE TABLE IF NOT EXISTS users (
|
|
|
696
700
|
|
|
697
701
|
INSERT INTO users (id, username, email, password_hash, role)
|
|
698
702
|
VALUES (
|
|
699
|
-
'
|
|
703
|
+
'00000000-0000-0000-0000-000000000001',
|
|
700
704
|
'admin',
|
|
701
705
|
'admin@example.com',
|
|
702
706
|
'178c20236d9629bffcb301f57d1b8383:40c49d6500a8f322754ac0cd2d5c9dea019a4c14feef60e436d767cc2dd44bc1eeee7ef16f1bd768260aeec4025e06c479c4c367537899002ec89962382a3104',
|
|
@@ -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.
|
|
6
|
+
"version": "0.3.1",
|
|
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.
|
|
24
|
-
"@heyhru/common-util-logger": "0.
|
|
25
|
-
"@heyhru/server-plugin-jwt": "0.
|
|
26
|
-
"@heyhru/server-plugin-mysql": "0.
|
|
27
|
-
"@heyhru/server-plugin-pg": "0.
|
|
28
|
-
"@heyhru/server-util-crypto": "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": "
|
|
40
|
+
"gitHead": "34b5ef9caab1f78253079b83eee01afcb9ac25d9"
|
|
41
41
|
}
|