File tree Expand file tree Collapse file tree
apps/api-gateway/src/middleware Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { loadConfig } from '@services/auth/src/config/env' ;
2+ import { createAuthMiddleware } from '@services/auth/src/middleware/auth.middleware' ;
3+
4+ type Middleware = ( req : unknown , res : unknown , next : ( ) => void ) => void ;
5+
6+ let guard : Middleware | null = null ;
7+
8+ /**
9+ * Provides the auth middleware from the auth service so the API gateway can
10+ * reuse the same JWT verification logic.
11+ */
12+ export function getAuthGuard ( ) : Middleware {
13+ if ( ! guard ) {
14+ const { authenticate } = createAuthMiddleware ( loadConfig ( ) ) ;
15+ guard = authenticate ;
16+ }
17+ return guard ;
18+ }
Original file line number Diff line number Diff line change 1+ # syntax=docker/dockerfile:1.5
2+
3+ FROM node:20-alpine AS base
4+ WORKDIR /app
5+
6+ RUN corepack enable
7+
8+ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json ./
9+ COPY packages/tooling/package.json packages/tooling/package.json
10+ COPY packages/logging/package.json packages/logging/package.json
11+ COPY packages/database/package.json packages/database/package.json
12+ COPY services/auth/package.json services/auth/package.json
13+
14+ RUN pnpm fetch --filter @scribemed/auth-service...
15+
16+ COPY . .
17+
18+ RUN pnpm install --filter @scribemed/auth-service... --prod --offline \
19+ && pnpm --filter @scribemed/auth-service run build
20+
21+ EXPOSE 8085
22+
23+ CMD ["node" , "services/auth/dist/index.js" ]
You can’t perform that action at this time.
0 commit comments