14 lines
341 B
TypeScript
14 lines
341 B
TypeScript
import type { Middleware } from "@paulaboks/sweet";
|
|
|
|
const middleware1: Middleware<{ text: string }> = async (ctx) => {
|
|
ctx.state.text = "A";
|
|
return await ctx.next();
|
|
};
|
|
|
|
const middleware2: Middleware<{ text: string }> = async (ctx) => {
|
|
ctx.state.text += "B";
|
|
return await ctx.next();
|
|
};
|
|
|
|
export default [middleware1, middleware2];
|