1.5.10 • Published 1 year ago

fastify-method-override v1.5.10

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

fastify-method-override

github action status Codacy Badge test coverage npm version

Plugin for Fastify, 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

Usage

import fastify from 'fastify';
import fastifyMethodOverride from 'fastify-method-override';

const app = fastify();

app.register(fastifyMethodOverride);

To override the HTTP method, use the HTML form with the hidden _method field and the value of the target method:

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

Note

If you use setNotFoundHandler, the plugin may not work correctly. In order to override the standard 404 error handler, you must use setErrorHandler.

If you are having trouble using the plugin, you can use the fastify-method-override-wrapper library.

1.5.10

1 year ago

1.5.9

2 years ago

1.5.8

2 years ago

1.5.6

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.2.2

4 years ago

1.1.3

4 years ago

1.2.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago