crypt-express-app 1.3.20 → 1.3.21
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/generate-module.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
|
@@ -12,7 +12,7 @@ export function generateApp(projectDir) {
|
|
|
12
12
|
import express, { Router } from 'express';
|
|
13
13
|
import swaggerUi from "swagger-ui-express";
|
|
14
14
|
import { swaggerSpec } from "./utils/swagger";
|
|
15
|
-
import
|
|
15
|
+
import iamRedis from './utils/iam.redis';
|
|
16
16
|
import prisma from './prisma/client';
|
|
17
17
|
import commonRoutes from "./modules/common/common.routes";
|
|
18
18
|
|
|
@@ -35,7 +35,7 @@ routers.get("/", (req, res) => {
|
|
|
35
35
|
* get:
|
|
36
36
|
* tags: [Root]
|
|
37
37
|
* summary: Health check endpoint
|
|
38
|
-
* description: Returns the status of the app,
|
|
38
|
+
* description: Returns the status of the app, iamRedis, and Supabase function.
|
|
39
39
|
* responses:
|
|
40
40
|
* 200:
|
|
41
41
|
* description: App health status
|
|
@@ -59,7 +59,7 @@ routers.get("/", (req, res) => {
|
|
|
59
59
|
* app:
|
|
60
60
|
* type: string
|
|
61
61
|
* example: ok
|
|
62
|
-
*
|
|
62
|
+
* iamRedis:
|
|
63
63
|
* type: string
|
|
64
64
|
* example: ok
|
|
65
65
|
* dbStatus:
|
|
@@ -71,13 +71,13 @@ routers.get("/", (req, res) => {
|
|
|
71
71
|
* example: 2026-03-11T10:21:00.000Z
|
|
72
72
|
*/
|
|
73
73
|
routers.get("/health/check", async (_req, res) => {
|
|
74
|
-
let
|
|
74
|
+
let iamRedisStatus = "ok";
|
|
75
75
|
let dbStatus = "ok";
|
|
76
76
|
|
|
77
77
|
try {
|
|
78
|
-
await
|
|
78
|
+
await iamRedis.ping();
|
|
79
79
|
} catch {
|
|
80
|
-
|
|
80
|
+
iamRedisStatus = "failed";
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
try {
|
|
@@ -92,7 +92,7 @@ routers.get("/health/check", async (_req, res) => {
|
|
|
92
92
|
message: "App health check",
|
|
93
93
|
services: {
|
|
94
94
|
app: "ok",
|
|
95
|
-
|
|
95
|
+
iamRedis: iamRedisStatus,
|
|
96
96
|
db: dbStatus,
|
|
97
97
|
},
|
|
98
98
|
time: new Date().toISOString(),
|
|
@@ -197,19 +197,30 @@ IAM_REDIS_URL=
|
|
|
197
197
|
fs.writeFileSync(path.join(projectDir, "example.env"), exampleEnv);
|
|
198
198
|
/* ================= DOCKERFILE ================= */
|
|
199
199
|
const dockerfile = `
|
|
200
|
-
FROM node:20-alpine
|
|
200
|
+
FROM node:20-alpine AS builder
|
|
201
201
|
|
|
202
202
|
WORKDIR /app
|
|
203
203
|
|
|
204
|
-
COPY package.json pnpm-lock.yaml
|
|
204
|
+
COPY package.json pnpm-lock.yaml ./
|
|
205
205
|
|
|
206
206
|
RUN npm install -g pnpm
|
|
207
|
+
|
|
207
208
|
RUN pnpm install
|
|
208
209
|
|
|
209
210
|
COPY . .
|
|
210
211
|
|
|
212
|
+
RUN npx prisma generate
|
|
213
|
+
|
|
211
214
|
RUN pnpm build
|
|
212
215
|
|
|
216
|
+
FROM node:20-alpine
|
|
217
|
+
|
|
218
|
+
WORKDIR /app
|
|
219
|
+
|
|
220
|
+
COPY --from=builder /app/node_modules ./node_modules
|
|
221
|
+
|
|
222
|
+
COPY --from=builder /app/dist ./dist
|
|
223
|
+
|
|
213
224
|
EXPOSE 3000
|
|
214
225
|
|
|
215
226
|
CMD ["node", "dist/server.js"]
|
|
@@ -56,7 +56,7 @@ export const iamCacheService = new IamCacheService();
|
|
|
56
56
|
|
|
57
57
|
export default redis;
|
|
58
58
|
`;
|
|
59
|
-
fs.writeFileSync(path.join(basePath, "iam.redis"), redisContent.trim());
|
|
59
|
+
fs.writeFileSync(path.join(basePath, "iam.redis.ts"), redisContent.trim());
|
|
60
60
|
/* ================= cache.ts ================= */
|
|
61
61
|
const cacheContent = `
|
|
62
62
|
// Centralized realm secret cache with TTL support
|
|
@@ -12,9 +12,9 @@ import "dotenv/config";
|
|
|
12
12
|
|
|
13
13
|
const connectionString = process.env.DATABASE_URL
|
|
14
14
|
|
|
15
|
-
const adapter = new PrismaPg({
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const adapter = new PrismaPg({
|
|
16
|
+
connectionString,
|
|
17
|
+
max: 10
|
|
18
18
|
})
|
|
19
19
|
const prisma = new PrismaClient({ adapter })
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crypt-express-app",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.21",
|
|
4
4
|
"description": "Crypt ExpressJS for building expressJS boilerplate on single command.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
"dist",
|
|
17
17
|
"README.md"
|
|
18
18
|
],
|
|
19
|
-
"keywords": [
|
|
19
|
+
"keywords": [
|
|
20
|
+
"ExpressJS"
|
|
21
|
+
],
|
|
20
22
|
"author": "",
|
|
21
23
|
"license": "ISC",
|
|
22
24
|
"packageManager": "pnpm@10.29.3",
|
|
@@ -25,4 +27,4 @@
|
|
|
25
27
|
"tsx": "^4.21.0",
|
|
26
28
|
"typescript": "^5.9.3"
|
|
27
29
|
}
|
|
28
|
-
}
|
|
30
|
+
}
|