* 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
23 lines
597 B
TypeScript
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;
|
|
}
|
|
}
|