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

1.0.0 • Public • Published

fastify-get-only

js-standard-style CI workflow

Supports Fastify versions 3.x

Install

npm i fastify-get-only

Usage

Require\Import fastify-get-only and register.

// CommonJS
const fastify = require('fastify')();

fastify.register(require('fastify-get-only'), {
  httpStatusCode: 400 // Default is 405
  errorPayload: {
    whateverYouWant: "Method not allowed"
  }
});

// ESM
import Fastify from 'fastify';
import FastifyGetOnly from 'fastify-get-only';

fastify.register(FastifyGetOnly, {
  httpStatusCode: 400,
  errorPayload: {
    whateverYouWant: "Method not allowed"
  }
})

License

Licensed under MIT.

Dependents (0)

Package Sidebar

Install

npm i fastify-get-only

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

5.63 kB

Total Files

9

Last publish

Collaborators

  • daniele.fedeli