๊ธฐ๋ณธ ๊ตฌ์กฐ
baseUrl
์ธ๋ถ์์ ์ ๊ทผ ๊ฐ๋ฅํ ์๋ฒ์ ์ ์ฒด URL์ ์ง์ ํฉ๋๋ค. ํ์ :string (์ ํ์ )
๊ธฐ๋ณธ๊ฐ: http://{listen.host}:{listen.port}
listen
์๋ฒ๊ฐ ์์ ํ ํฌํธ์ ํธ์คํธ๋ฅผ ์ค์ ํฉ๋๋ค. ํ์ : (์ ํ์ )port
์๋ฒ๊ฐ ์์ ํ ํฌํธ ๋ฒํธ์ ๋๋ค. ํ์ :number
host
์๋ฒ๊ฐ ๋ฐ์ธ๋ฉํ ํธ์คํธ ์ฃผ์์ ๋๋ค. ํ์ :string (์ ํ์ )
๊ธฐ๋ณธ๊ฐ: "localhost"
fastify
Fastify ์๋ฒ ์ต์ ์ ์ค์ ํฉ๋๋ค. ํ์ :Omit<FastifyServerOptions, "logger"> (์ ํ์ )
๋ก๊น
์ Sonamu์
logging ์ค์ ์ ํตํด ๋ณ๋๋ก ๊ตฌ์ฑํฉ๋๋ค.plugins
Fastify ํ๋ฌ๊ทธ์ธ์ ํ์ฑํํ๊ณ ์ค์ ํฉ๋๋ค.formbody
application/x-www-form-urlencoded ์์ฒญ ๋ณธ๋ฌธ์ ํ์ฑํฉ๋๋ค.
ํ์
: boolean | FastifyFormbodyOptions (์ ํ์ )
qs
์ฟผ๋ฆฌ ์คํธ๋ง์ ํ์ฑํฉ๋๋ค. ์ค์ฒฉ๋ ๊ฐ์ฒด์ ๋ฐฐ์ด์ ์ง์ํฉ๋๋ค. ํ์ :boolean | QsPluginOptions (์ ํ์ )
multipart
ํ์ผ ์ ๋ก๋๋ฅผ ์ฒ๋ฆฌํฉ๋๋ค (multipart/form-data).
ํ์
: boolean | FastifyMultipartOptions (์ ํ์ )
static
์ ์ ํ์ผ์ ์ ๊ณตํฉ๋๋ค. ํ์ :boolean | FastifyStaticOptions (์ ํ์ )
/api/public/images/logo.png โ public/images/logo.png ํ์ผ
session
์ธ์ ๊ด๋ฆฌ๋ฅผ ํ์ฑํํฉ๋๋ค. ํ์ :boolean | SecureSessionPluginOptions (์ ํ์ )
compress
์๋ต์ ์์ถํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ณ๋ ๋ฌธ์๋ฅผ ์ฐธ์กฐํ์ธ์. ํ์ :boolean | FastifyCompressOptions (์ ํ์ )
cors
CORS(Cross-Origin Resource Sharing)๋ฅผ ์ค์ ํฉ๋๋ค. ํ์ :boolean | FastifyCorsOptions (์ ํ์ )
sse
Server-Sent Events๋ฅผ ์ง์ํฉ๋๋ค. ํ์ :boolean | SsePluginOptions (์ ํ์ )
custom
์ปค์คํ Fastify ํ๋ฌ๊ทธ์ธ์ ๋ฑ๋กํฉ๋๋ค. ํ์ :(server: FastifyInstance) => void (์ ํ์ )
apiConfig
API ๋์ ๋ฐฉ์์ ์ค์ ํฉ๋๋ค.contextProvider
๊ฐ API ํธ์ถ๋ง๋ค Context๋ฅผ ์์ฑํ๋ ํจ์์ ๋๋ค. ํ์ :(defaultContext, request) => Context
guardHandler
Guard ๋ฐ์ฝ๋ ์ดํฐ ์คํ ์ ํธ์ถ๋๋ ํจ์์ ๋๋ค. ํ์ :(guard, request, api) => void | Promise<void>
cacheControlHandler
Cache-Control ํค๋๋ฅผ ์ค์ ํ๋ ํจ์์ ๋๋ค. ํ์ :(req) => string | undefined
lifecycle
์๋ฒ ๋ผ์ดํ์ฌ์ดํด ์ด๋ฒคํธ์ ํ ์ ๋ฑ๋กํฉ๋๋ค.onStart
์๋ฒ๊ฐ ์์๋ ๋ ์คํ๋ฉ๋๋ค. ํ์ :(server: FastifyInstance) => void | Promise<void>
onShutdown
์๋ฒ๊ฐ ์ข ๋ฃ๋ ๋ ์คํ๋ฉ๋๋ค (graceful shutdown). ํ์ :(server: FastifyInstance) => void | Promise<void>
onError
์ฒ๋ฆฌ๋์ง ์์ ์๋ฌ๊ฐ ๋ฐ์ํ์ ๋ ์คํ๋ฉ๋๋ค. ํ์ :(error, request, reply) => void | Promise<void>