Functions naming
Why middleware is the one word to keep out of a middleware function name, and how to name a dozen of them so the entry file still reads clearly.
Avoid using the default middleware name or prefix/suffix for your functions. Instead, use a more descriptive name that reflects the purpose of the function. This will make your code easier to understand and maintain.
Proposal
export const internal = async ({ request }: MiddlewareFunctionProps) => {
// function body
};
export const team = async ({ request }: MiddlewareFunctionProps) => {
// function body
};
export const analytics = async ({ request }: MiddlewareFunctionProps) => {
// function body
};
Related topics
Was this helpful?
M↓supported.