A wrapper for the Whook HTTP Transaction service to handle patch method compatibility.
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 $;
}
// (...)