Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: translate reference request #25

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 2 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
87 changes: 43 additions & 44 deletions docs/Reference/Request.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,61 @@
<h1 align="center">Fastify</h1>

## Request
The first parameter of the handler function is `Request`.
핸들러 함수의 첫 번째 매개변수는 `Request` 입니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

매개변수는 파라미터로 통일해서 사용하고 있어요~
위키 참고 부탁드립니닷!!!


Request is a core Fastify object containing the following fields:
- `query` - the parsed querystring, its format is specified by
[`querystringParser`](./Server.md#querystringparser)
- `body` - the request payload, see [Content-Type
Parser](./ContentTypeParser.md) for details on what request payloads Fastify
natively parses and how to support other content types
- `params` - the params matching the URL
- [`headers`](#headers) - the headers getter and setter
- `raw` - the incoming HTTP request from Node core
- `server` - The Fastify server instance, scoped to the current [encapsulation
context](./Encapsulation.md)
- `id` - the request ID
- `log` - the logger instance of the incoming request
- `ip` - the IP address of the incoming request
- `ips` - an array of the IP addresses, ordered from closest to furthest, in the
`X-Forwarded-For` header of the incoming request (only when the
[`trustProxy`](./Server.md#factory-trust-proxy) option is enabled)
- `hostname` - the host of the incoming request (derived from `X-Forwarded-Host`
header when the [`trustProxy`](./Server.md#factory-trust-proxy) option is
enabled). For HTTP/2 compatibility it returns `:authority` if no host header
exists.
- `protocol` - the protocol of the incoming request (`https` or `http`)
- `method` - the method of the incoming request
- `url` - the URL of the incoming request
- `routerMethod` - the method defined for the router that is handling the
request
- `routerPath` - the path pattern defined for the router that is handling the
request
- `is404` - true if request is being handled by 404 handler, false if it is not
- `connection` - Deprecated, use `socket` instead. The underlying connection of
the incoming request.
- `socket` - the underlying connection of the incoming request
- `context` - A Fastify internal object. You should not use it directly or
modify it. It is useful to access one special key:
- `context.config` - The route [`config`](./Routes.md#routes-config) object.
Request 는 다음 필드를 포함하는 Fastify 객체의 핵심입니다:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request는 다음 필드를 포함하는 Fastify 핵심 객체입니다:
로 번역하는 게 맞겠습니다.
Fastify 객체의 핵심이 아니라 Fastify 프레임워크의 핵심 객체라는 의미로 읽혀야 하니까요!

- `query` - 문법적으로 분석된 쿼리스트링, 이의 형식은 [`querystringParser`](./Server.md#querystringparser) 에 의해 지정됩니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

의미상으론 문제 없지만 직역이라 딱딱한 느낌이네요.
~문법적으로 분석된 쿼리스트링입니다. (이의 빼고) 형식은 ~ 지정됩니다.
로 번역하면 어떨까요?

- `body` - 요청 페이로드, Fastify 가 기본적으로 문법적으로 분석하는 요청 페이로드와 어떻게 다른 콘텐츠 유형을 지원하는지에 대한 세부 정보는
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

문법적으로 분석하는-> 파싱하는이 나을 거 같아요~

[Content-Type Parser](./ContentTypeParser.md) 를 참조하십시오.
- `params` - URL 헤더와 일치하는 params
- [`headers`](#headers) - 헤더의 getter 와 setter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

게터와 세터는 번역서나 한글 버전 공식 문서에서도 대부분 한글로 사용하는 만큼 한글로 쓰는 것이 좋겠습니다

- `raw` - Node core 에서 들어오는 HTTP 요청
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node core -> 노드 코어

- `server` - 현재 [캡슐화 컨텍스트](./Encapsulation.md)에 대해 스코프된 Fastify 서버 인스턴스
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 [캡슐화된 컨텍스트](./Encapsulation.md)를 스코프로 하는 Fastify 서버 인스턴스가 더 자연스럽겠어요.

- `id` - 요청 ID
- `log` - 요청에 들어오는 로그 인스턴스
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로그 -> 로거

- `ip` - 요청에 들어오는 IP 주소
- `ips` - 가장 가까운 IP 주소부터 가장 먼 IP 주소까지의 주소 배열이 `X-Forwarded-For` 헤더에 들어 있습니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

원어를 따라 아래와 같이 번역하는 것이 자연스럽게 느껴져요.
아래 예시 참고해주세요~

요청의 `X-Forwarded-For` 헤더에 있는, 가장 가까운 IP 주소부터 가장 먼 IP 주소까지의 순서로 나열된, IP 주소 배열. (단, [`trustProxy`](./Server.md#factory-trust-proxy) 옵션이 활성화되어 있을 시)

(단, [`trustProxy`](./Server.md#factory-trust-proxy) 옵션이 활성화되어 있어야 합니다.)
- `hostname` - 요청에 들어오는 호스트 ([`trustProxy`](./Server.md#factory-trust-proxy) 옵션이 활성화되어 있을 때,
`X-Forwarded-Host` 헤더에서 파생됩니다). HTTP/2 호환성을 위해 호스트 헤더가 존재하지 않으면 `:authority` 를 반환합니다.
- `protocol` - 요청에 들어오는 프로토콜 (`https` or `http`)
- `method` - 요청에 들어오는 메소드
- `url` - 요청에 들어오는 URL
- `routerMethod` - 요청을 처리하는 라우터에 정의된 메소드
- `routerPath` - 요청을 처리하는 라우터에 정의된 경로 패턴
- `is404` - 404 핸들러가 요청을 처리하고 있으면 true, 처리하지 않고 있으면 false.
- `connection` - 사용되지 않음, 대신 `socket` 을 사용하세요. 요청에 들어오는 기반 연결.
- `socket` - 요청에 들어오는 기반 연결.
- `context` - Fastify 의 내부 객체.당신은 직접적으로 사용하거나 수정하지 마십시오.
이것은 특정 키에 액세스하는 데 유용합니다:
- `context.config` - 경로[`구성`](./Routes.md#routes-config)객체.
- routeSchema - 요청을 처리하는 라우터에 설정된 스키마 정의
- routeConfig - 경로[`구성`](./Routes.md#routes-config)객체.
- routeOptions - 경로[`옵션`](./Routes.md#routes-options)객체
- bodyLimit - 서버 제한 또는 경로 제한
- method - 경로의 HTTP 메소드
- url - 이 경로와 일치할 URL 의 경로
- attachValidation - `validationError` 를 요청에 첨부 (스키마가 정의되어 있을 경우)
- logLevel - 이 경로에 대한 로그 레벨 정의
- version - 엔드 포인트의 버전을 정의하는 semver 호환 문자열
- exposeHeadRoute - GET 경로에 대한 자식 HEAD 경로 생성
- prefixTrailingSlash - 접두사가 있을 경우 /를 경로로 전달하는 방식을 결정하는 문자열.

### Headers

The `request.headers` is a getter that returns an Object with the headers of the
incoming request. You can set custom headers like this:
`request.headers` 는 들어오는 요청의 헤더를 가진 객체를 반환하는 getter 입니다.
아래처럼 사용자 정의 헤더를 설정할 수 있습니다:

```js
request.headers = {
'foo': 'bar',
'baz': 'qux'
}
```
이 작업은 `request.headers.bar` 를 호출하여 읽을 수 있는 새로운 값을 요청 헤더에 추가합니다.
또한, `request.raw.headers` 속성을 사용하여 표준 요청 헤더에 액세스 할 수 있습니다.

This operation will add to the request headers the new values that can be read
calling `request.headers.bar`. Moreover, you can still access the standard
request's headers with the `request.raw.headers` property.

> Note: For performance reason on `not found` route, you may see that we will
add an extra property `Symbol('fastify.RequestAcceptVersion')` on the headers.
> Note: 성능상의 이유로 `not found` 경로에서 헤더에 Symbol('fastify.RequestAcceptVersion') 추가 속성을 볼 수 있습니다.

```js
fastify.post('/:params', options, function (request, reply) {
Expand Down