Skip to content

Commit

Permalink
Update vclSdkPlugin.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelavoyan committed Jul 1, 2024
1 parent 2fdcba6 commit 16e5054
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/sample-server/src/plugins/vclSdkPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { FastifyPluginAsync, FastifyInstance } from 'fastify';
import {
VCLProvider,
VCLInitializationDescriptor,
Expand All @@ -18,7 +17,7 @@ import {
} from '../crypto-services';
import { CurrentEnvironment, XVnfProtocolVersion } from '../global-config';

const vclSdkPlugin: FastifyPluginAsync = async (fastify: FastifyInstance) => {
const vclSdkPlugin = async (fastify) => {
const vclSdk = VCLProvider.getInstance();

const initializationDescriptor = new VCLInitializationDescriptor(
Expand All @@ -40,11 +39,10 @@ const vclSdkPlugin: FastifyPluginAsync = async (fastify: FastifyInstance) => {

fastify.decorate('vclSdk', vclSdk);

const setVclSdk = async (req: any, reply: any) => {
const setVclSdk = async (req, reply) => {
req.vclSdk = fastify.vclSdk;
reply.vclSdk = fastify.vclSdk;
};

fastify.addHook('preHandler', setVclSdk);
fastify.addHook('preValidation', setVclSdk);
};
Expand Down

0 comments on commit 16e5054

Please sign in to comment.