Skip to content

Support manual hook injection #599

Description

@Mikescops

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

I have multiple hooks during the preValidation step including hooks that modify the content or run a signature check on the content. Because the hook is registered at the instance boot and not at the route level i cannot decide on the hooks order.

fastify.addHook('preValidation', async function (req) {

Would it be possible to put the hook in a dedicated exported function and add a new parameter to allow to manually load the hook via the function?

Motivation

No response

Example

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions