Skip to content

Astro Middleware documentation #3069

@ematipico

Description

@ematipico

The platform team is about the add a new feature in astro. The feature is called "Astro middleware".

Few useful links:

A middleware unlocks two major things:

  • do various operations based on the Request and Response, and also modify the Response before being rendered; a user can also return a new Response;
  • store contextual information inside a new global called Astro.locals/context.locals (they're the same object), and then render something based on this Astro.locals;

Metadata

Metadata

Assignees

No one assigned

    Labels

    add new contentDocument something that is not in docs. May require testing, confirmation, or affect other pages.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions