CognxSafeTrack commited on
Commit
255a85a
Β·
1 Parent(s): 89847a8

fix: add 'as any' casts to resolve TS2769 plugin registration errors (cors, rate-limit, bullboard)

Browse files
apps/api/src/index.ts CHANGED
@@ -27,7 +27,7 @@ const server: FastifyInstance = fastify({
27
  server.decorate('prisma', prisma);
28
 
29
  // ── Middleware & Plugins ──────────────────────────────────────────────────────
30
- server.register(cors, {
31
  origin: [
32
  'https://admin.xamle.studio',
33
  'https://xamle.studio',
 
27
  server.decorate('prisma', prisma);
28
 
29
  // ── Middleware & Plugins ──────────────────────────────────────────────────────
30
+ server.register(cors as any, {
31
  origin: [
32
  'https://admin.xamle.studio',
33
  'https://xamle.studio',
apps/api/src/middleware/rateLimit.ts CHANGED
@@ -4,7 +4,7 @@ import { logger } from '../logger';
4
 
5
  export async function setupRateLimit(server: FastifyInstance) {
6
  try {
7
- await server.register(rateLimit, {
8
  max: 100,
9
  timeWindow: '1 minute',
10
  errorResponseBuilder: (_request, context) => {
 
4
 
5
  export async function setupRateLimit(server: FastifyInstance) {
6
  try {
7
+ await server.register(rateLimit as any, {
8
  max: 100,
9
  timeWindow: '1 minute',
10
  errorResponseBuilder: (_request, context) => {
apps/api/src/routes/internal.ts CHANGED
@@ -34,7 +34,7 @@ export async function internalRoutes(fastify: FastifyInstance) {
34
  // Re-enabled BullBoard for production monitoring
35
  serverAdapter.setBasePath('/v1/internal/queues');
36
  fastify.register(async (instance) => {
37
- instance.register(serverAdapter.registerPlugin(), {
38
  prefix: '/',
39
  });
40
  }, {
 
34
  // Re-enabled BullBoard for production monitoring
35
  serverAdapter.setBasePath('/v1/internal/queues');
36
  fastify.register(async (instance) => {
37
+ instance.register(serverAdapter.registerPlugin() as any, {
38
  prefix: '/',
39
  });
40
  }, {