Set of Typescript decorators to build Fastify server with controllers, services and hooks
MIT License
Bot releases are hidden (Show)
useDefineForClassFields
TypeScript flagPublished by L2jLiga about 2 years ago
classLoader
, allows to implement own DI logic instead of fastify-decorators provides. See Using custom class loader for more details.tags
, allows to specify set of tags for all methods in controller, useful for grouping methods in swaggerPublished by L2jLiga over 2 years ago
Bootstrap autoload config now accepts PathLike
instead of just string. This is useful for ESM projects by simplifying code:
before:
import 'reflect-metadata';
import { fastify } from 'fastify';
import { bootstrap } from 'fastify-decorators';
import * as path from 'path';
import { fileURLToPath } from 'url';
export const app = fastify();
app.register(bootstrap, {
directory: path.dirname(fileURLToPath(import.meta.url)),
});
after:
import 'reflect-metadata';
import { fastify } from 'fastify';
import { bootstrap } from 'fastify-decorators';
export const app = fastify();
app.register(bootstrap, {
directory: import.meta.url,
});
appInit
hook executed before application starts Controllers/Handlers loadingappInit
, appReady
and appDestroy
hooks now can access FastifyInstanceconfigureControllerTest
and configureServiceTest
plugins option now accepts Maps and SetsconfigureServiceTest
injects FastifyInstance