fastify-beanify
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.1 • Public • Published

    fastify-beanify

    Fastify plugin to integrate Beanify

    Install

    npm i fastify-beanify --save

    with yarn

    yarn add fastify-beanify

    Usage

    const { fastify: Fastify } = require('fastify')
    const Beanify = require('fastify-beanify')
    
    const fastify = Fastify({
      logger: true
    })
    
    fastify.register(Beanify, {
      autoload: [
        {
          dir: 'services',
          dirAsScope: true
        }
      ]
    })
    fastify.route({
      url: '/test',
      method: 'GET',
      async handler (req, rep) {
        await rep.inject({
          url: 'add',
          body: {
            a: 1,
            b: 2
          }
        })
      }
    })
    fastify.ready(() => {
      fastify.beanify.print()
    })
    fastify.listen(3000)

    Options

    • beanify: beanify configuration.check here
    • autoload: (array) beanify plug-ins that need to be loaded automatically.default []
      • dir: (required) - Base directory containing plugins to be loaded
      • dirAsScope: Make each directory a new scope.default false

    Fastify Decorators

    • beanify: the scope beanify instance.check here

    Fastify Request Decorators

    • beanify: the scope beanify instance.check here

    Fastify Reply Decorators

    • inject(opts): start a beanify request.check here

    Beanify Decorators

    • $fastify: the scope fastify instance.check here

    Install

    npm i fastify-beanify

    DownloadsWeekly Downloads

    2

    Version

    3.0.1

    License

    MIT

    Unpacked Size

    8.04 kB

    Total Files

    11

    Last publish

    Collaborators

    • beanjs