Files
verdaccio/packages/server/fastify/src/plugins/config.ts
Juan Picado 00d1d2a179 chore: env variable for launch fastify (#3295)
* chore: relocate package server

* chore: relocate server packages

* Update ci.yml

* rename packages

* rename package

* chore: refactor fastify endpoints

* chore: fix types requests

* fix warnings

* chore: refactor endpoints

* refactor launch fastify

* Update package.json

* chore: update deps

* Create green-yaks-divide.md
2022-08-08 07:14:23 +02:00

23 lines
597 B
TypeScript

import { FastifyInstance } from 'fastify';
import fp from 'fastify-plugin';
import { Config as AppConfig } from '@verdaccio/config';
import { ConfigYaml, Config as IConfig } from '@verdaccio/types';
export default fp(
async function (fastify: FastifyInstance, opts: { config: ConfigYaml }) {
const { config } = opts;
const configInstance: IConfig = new AppConfig(Object.assign({}, config) as any);
fastify.decorate('configInstance', configInstance);
},
{
fastify: '>=4.x',
}
);
declare module 'fastify' {
interface FastifyInstance {
configInstance: IConfig;
}
}