Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/content/docs/ko/guides/middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Since from '~/components/Since.astro';
// 요청의 응답 데이터 가로채기
// 선택적으로 `locals`의 속성을 수정합니다.
context.locals.title = "새로운 제목";
context.locals.property = "정보";

// Response 객체 또는 `next()` 함수의 호출 결과를 반환합니다.
return next();
Expand Down Expand Up @@ -62,10 +63,12 @@ import Since from '~/components/Since.astro';
export function onRequest (context, next) {
// 요청의 응답 데이터 가로채기
// 선택적으로 `locals`의 속성을 수정합니다.
context.locals.user.name = "John Wick";
context.locals.user = { id: 1, name: "John Wick" };
context.locals.welcomeTitle = () => {
return "반가워요 " + locals.user.name;
return "반가워요 " + context.locals.user.name;
};
context.locals.orders = new Map([["1", { product: "양말" }]]);
context.locals.property = "정보";

// Response 객체 또는 `next()` 함수의 호출 결과를 반환합니다.
return next();
Expand Down
Loading