Skip to content

Commit

Permalink
fix(fastify): removed cors function there is a package called @fastif…
Browse files Browse the repository at this point in the history
…y/cors
  • Loading branch information
Stradivario committed Apr 3, 2024
1 parent 51c8e0b commit 00f3d0d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 39 deletions.
5 changes: 2 additions & 3 deletions packages/fastify/src/fastify.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Module, ModuleWithProviders } from '@rhtml/di';
import fastify, { FastifyInstance } from 'fastify';

import { Fastify, FastifyListen, FastifyModuleOptions } from './fastify.tokens';
import { addSchema, corsHook, globalErrorHandler, pipe } from './helpers';
import { addSchema, globalErrorHandler, pipe } from './helpers';

@Module()
export class FastifyModule {
Expand All @@ -26,8 +26,7 @@ export class FastifyModule {

return pipe(
addSchema(schemas),
globalErrorHandler(options.globalErrorHandler),
corsHook(options.cors)
globalErrorHandler(options.globalErrorHandler)
)(instance);
},
},
Expand Down
3 changes: 0 additions & 3 deletions packages/fastify/src/fastify.tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
FastifySchema,
} from 'fastify';

import { CorsOptions } from './helpers/hooks/cors.hook';

export const Fastify = new InjectionToken<FastifyInstance>();
export const FastifyListen = new InjectionToken<string>();

Expand All @@ -33,6 +31,5 @@ export interface FastifyModuleOptions extends FastifyHttpOptions<never> {
plugins: FastifyPlugin[];
schemas: FastifySchema[];
globalErrorHandler: GlobalErrorHandler;
cors: CorsOptions;
server: FastifyListenOptions;
}
32 changes: 0 additions & 32 deletions packages/fastify/src/helpers/hooks/cors.hook.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/fastify/src/helpers/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './cors.hook';
export * from './add-schema.hook';
export * from './global-error.hook';

0 comments on commit 00f3d0d

Please sign in to comment.