1.0.6 • Published 3 years ago

fastify-method-override-wrapper v1.0.6

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

fastify-method-override-wrapper

github action status Codacy Badge codecov npm version

Fastify wrapper, which allows use HTTP verbs, such as DELETE, PATCH, HEAD, PUT, OPTIONS in case the client doesn't support them. Supports Fastify versions >=2.0.0.

Install

npm install fastify-method-override-wrapper

Usage

import fastify from 'fastify';
import wrapFastify from 'fastify-method-override-wrapper';

const wrappedFastify = wrapFastify(fastify);
const app = wrappedFastify({
  // any fastify options, for example logger
  logger: true,
});

To override an HTTP method, use an HTML form with the overridden method in the query string of the URL.

<form method="POST" action="/url/?_method=DELETE">
  <input type="submit" value="Submit">
</form>
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago