NestJS์์ ๊ฐ๋จํ API๋ฅผ ์์ฑํด๋ณด์.์ ์ผ ๋ง์ด ์ฌ์ฉํ๋ ToDo ๊ธฐ๋ฅ์ API๋ฅผ ์์ฑํด๋ณด์. ๐ TODO๐น๏ธ*.controller.tsAPI์ ์ง์
์ .์ฆ, ์์ฒญ์ ๋ฐ๋ ๊ณณ์ ์ ์ํ๋ค. โ
URL ๋ผ์ฐํ
์ ์ (@Get(), @Post ๋ฑ)โ
์์ฒญ Parameter, Body ๋ฐ๋๋ค.โ
๋น์ฆ๋์ค ๋ก์ง์ ์์ฑํ์ง ์๋๋ค.โ
๋๋ถ๋ถ service์ ์ผ์ "์์" "/todos" ๊ฒฝ๋ก๋ก ์์ฒญ์ ๋ณด๋์ ๋ CRUD๋ฅผ ์์ฑ.import { Controller, Get, Post, Body, Param, Patch, Delete } from '@nestjs/common';import { TodosService } from './todos.service';@Controller('todos')export cl..
API
๐๏ธ QueryKey๋?React Query์์ ์บ์๋ ๋ฐ์ดํฐ๋ฅผ ์๋ณํ๋ ๊ณ ์ ํ ํค์ด๋ค.JavaScript ๋ฐฐ์ด ํํ๋ก ์ ์๋๋ฉฐ, ์บ์๋ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๊ณ ์กฐํํ๋๋ฐ ์ฌ์ฉํ๋ค.// ๊ฐ๋จํ ํํ['todos']// ๊ตฌ์ฒด์ ์ธ ํํ['todos', 'list']['todos', 'detail', 1]['todos', 'list', {status: 'done', page: 1}] ๐ท๐ป QueryKey ์ญํ โ
์บ์ ์๋ณ์๊ฐ ์ฟผ๋ฆฌ์ ๊ฒฐ๊ณผ๋ฅผ ์บ์์ ์ ์ฅํ ๋ ์ฌ์ฉํ๋ ํค์ด๋ค.๋์ผํ QueryKey๋ฅผ ๊ฐ์ง ์ฟผ๋ฆฌ๋ ๊ฐ์ ๋ฐ์ดํฐ๋ฅผ ๊ณต์ ํ๋ค. โ
์์กด์ฑ ๊ด๋ฆฌQueryKey๊ฐ ๋ณ๊ฒฝ๋๋ฉด ์๋์ผ๋ก ์๋ก์ด ๋ฐ์ดํฐ๋ฅผ fetch ํ๋ค.ํ๋ผ๋ฏธํฐ๊ฐ ํฌํจ๋ QueryKey๋ ์์กด์ฑ์ฒ๋ผ ๋์ํ๋ค.// userId๊ฐ ๋ณ๊ฒฝ๋ ๋๋ง๋ค ์๋..
์ฐธ๊ณ ์ฌ์ดํธ• Transtack Query ๊ณต์ ๋ฌธ์ TanStack Start Overview | TanStack Start React DocsTanStack Start is a full-stack React framework powered by TanStack Router. It provides a full-document SSR, streaming, server functions, bundling, and more using tools like and . It is ready to deploy...tanstack.com• HEROPY.DEV ๋์ ๋ธ๋ก๊ทธ TanStack Query(React Query) ํต์ฌ ์ ๋ฆฌTanStack Query๋ ์๋ฒ๋ก๋ถํฐ ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ, ๋ฐ์ดํฐ ์บ์ฑ, ์บ์ ์ ์ด ๋ฑ ๋ฐ์ด..
์ฐธ๊ณ ์ฌ์ดํธ • gofo-coding๋์ ํฐ์คํ ๋ฆฌ ๐ฟ OpenGL Open Graphics Library๋ก, Graphics ํ๋ก๊ทธ๋๋ฐ์ ์ํ API์
๋๋ค. (Library ์ด๋ฆ๊ณผ ๋ฌ๋ฆฌ API์ด๋ค.) ๋๋ณด๊ธฐ ๐ Library • Collection of functions, pre-compiled routines or reusable components of code → ์ฝ๋๋ฅผ ๋ชจ์๋์ ๊ฒ • ์ฝ๋์ ๋ฐ๋ณต์ ์ค์ด๊ณ ์ฌ์ฌ์ฉ ํ ์ ์๊ฒ ํ๋ค. • ํ๋ก๊ทธ๋๋ฐ ์๋๋ฅผ ๋จ์ถํ ์ ์๋ค. ๐ API • Collection of software protocols → ์ธํฐํ์ด์ค๋ฅผ ๋ชจ์๋์ ๊ณณ • ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ก ๋ง๋ค์ด์ ธ์์ ์ ์๋ค. • ๋ค๋ฅธ ๊ธฐ๋ฅ์ ์ํํ๊ธฐ ์ํด ๋ค๋ฅธ Utility Library๊ฐ ํ์ OS๋ OpenG..