@whook/method-override
TypeScript icon, indicating that this package has built-in type declarations

16.1.0 • Public • Published

@whook/method-override

A wrapper for the Whook HTTP Transaction service to handle patch method compatibility.

GitHub license

To use this Whook module, simply override the httpTransaction service into your main file (usually in src/index.ts):

+import initHTTPTransaction from '@whook/http-transaction';
+import wrapHTTPTransactionWithMethodOverride from '@whook/method-override';

// (...)

// The `prepareEnvironment` one is intended to prepare the server environment
export async function prepareEnvironment(
  $: Knifecycle = new Knifecycle(),
): Promise<Knifecycle> {
  $ = await prepareBaseEnvironment($);

  // (...)

+  // Add method override to the server
+  $.register(
+    wrapHTTPTransactionWithMethodOverride(initHTTPTransaction),
+  );

  return $;
}

// (...)

API

Authors

License

MIT

Package Sidebar

Install

npm i @whook/method-override

Weekly Downloads

8

Version

16.1.0

License

MIT

Unpacked Size

28.5 kB

Total Files

12

Last publish

Collaborators

  • nfroidure