0.5.0 • Published 1 year ago

@finwo/router-fastify v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@finwo/router-fastify

license npm version

@finwo/router-fastify is a fastify adapter for the @finwo/router router decorators.

Installation

To start using @finwo/router-fastify, install the required packages via NPM:

npm install --save @finwo/router @finwo/router-fastify

Usage

To use this adapter to load your controllers into fastify, add the following to the initialization of your fastify instance.

// index.ts
import fastify = require('fastify')();
import { plugin } from '@finwo/router-fastify';

// Build a list of controllers we'll start our application with
// Classes registered as controller will NOT be included by default
import { SomeController } from './some-controller';
const controllers: any[] = [
  SomeController,
];

// Register your controllers' routes
fastify.register(plugin, controllers);

For further usage, check out the @finwo/router readme.

Middleware

This adapter does support middleware, by chaining the middleware before the actual route handler.

0.5.0

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago