Skip to content

Commit

Permalink
서식 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
kangju2000 committed Jun 30, 2023
1 parent 09b24f6 commit 6db91e6
Showing 1 changed file with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export const config = {
```js filename="middleware.js"
export const config = {
matcher: [
/*
* 다음과 같이 시작하는 경로를 제외한 모든 요청 경로와 일치시킵니다:
* - api (API 경로)
* - _next/static (정적 파일)
* - _next/image (이미지 최적화 파일)
* - favicon.ico (파비콘 파일)
*/
/*
* 다음과 같이 시작하는 경로를 제외한 모든 요청 경로와 일치시킵니다:
* - api (API 경로)
* - _next/static (정적 파일)
* - _next/image (이미지 최적화 파일)
* - favicon.ico (파비콘 파일)
*/
'/((?!api|_next/static|_next/image|favicon.ico).*)',
],
}
Expand All @@ -87,7 +87,7 @@ matcher 구성:

1. 반드시 `/`로 시작해야 합니다.
2. 이름 있는 매개변수를 포함할 수 있습니다: `/about/:path``/about/a``/about/b`와 일치하지만 `/about/a/c`와는 일치하지 않습니다.
3. 이름 있는 매개변수에는 수정자(콜론으로 시작함)를 사용할 수 있습니다: `/about/:path*``*`_0개 이상_을 의미하기 때문에 `/about/a/b/c`와 일치합니다. `?`_0개 또는 1개_, `+`_1개 이상_을 의미합니다.
3. 이름 있는 매개변수에는 수정자(콜론으로 시작함)를 사용할 수 있습니다: `/about/:path*``*`*0개 이상* 의미하기 때문에 `/about/a/b/c`와 일치합니다. `?`_0개 또는 1개_, `+`*1개 이상* 의미합니다.
4. 괄호로 둘러싸인 정규식을 사용할 수 있습니다: `/about/(.*)``/about/:path*`와 동일한 의미를 가집니다.

자세한 내용은 [path-to-regexp](https://github.com/pillarjs/path-to-regexp#path-to-regexp-1) 문서를 참조하세요.
Expand Down Expand Up @@ -174,7 +174,6 @@ import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'

export function middleware(request: NextRequest) {

// 요청 헤더를 복제하고 새로운 헤더 `x-hello-from-middleware1`를 설정
const requestHeaders = new Headers(request.headers)
requestHeaders.set('x-hello-from-middleware1', 'hello')
Expand Down Expand Up @@ -326,10 +325,10 @@ export default async function middleware(req) {

## 버전 기록

| 버전 | 변경 내용 |
| --------- | --------------------------------------------------------------------------------------------- |
| `v13.1.0` | 고급 미들웨어 플래그 추가 |
| `v13.0.0` | 미들웨어에서 요청 헤더, 응답 헤더를 수정하고 응답을 전송할 수 있도록 함 |
| 버전 | 변경 내용 |
| --------- | --------------------------------------------------------------------------------------------------- |
| `v13.1.0` | 고급 미들웨어 플래그 추가 |
| `v13.0.0` | 미들웨어에서 요청 헤더, 응답 헤더를 수정하고 응답을 전송할 수 있도록 함 |
| `v12.2.0` | 미들웨어가 안정화되었으며 [업그레이드 가이드](/docs/messages/middleware-upgrade-guide)를 참조하세요 |
| `v12.0.9` | Edge Runtime에서 절대 URL 강제 적용 ([PR](https://github.com/vercel/next.js/pull/33410)) |
| `v12.0.0` | 미들웨어 (Beta) 추가 |
| `v12.0.9` | Edge Runtime에서 절대 URL 강제 적용 ([PR](https://github.com/vercel/next.js/pull/33410)) |
| `v12.0.0` | 미들웨어 (Beta) 추가 |

0 comments on commit 6db91e6

Please sign in to comment.