Skip to content

doc: Usage .path in HTTPEvent is not correct #4375

Description

@Nayeem-4-You

https://nitro.build/docs/lifecycle#request-hook

The example shown here uses:

`console.log(`Incoming request on ${event.path}`);

in:

import { definePlugin } from "nitro";

export default definePlugin((nitroApp) => {
  nitroApp.hooks.hook("request", (event) => {
    console.log(`Incoming request on ${event.path}`);
  });
});

The event here is an HTTPEvent not H3Event, so there is no path property in this event.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions