{"id":41104,"date":"2024-11-06T02:46:35","date_gmt":"2024-11-06T02:46:35","guid":{"rendered":"https:\/\/atmokpo.com\/w\/?p=41104"},"modified":"2024-11-26T06:37:34","modified_gmt":"2024-11-26T06:37:34","slug":"43-next-js%ec%99%80-nest-js%ec%97%90%ec%84%9c-api-%ec%ba%90%ec%8b%b1%ea%b3%bc-%ec%84%b1%eb%8a%a5-%ec%b5%9c%ec%a0%81%ed%99%94-redis%eb%a5%bc-%ec%82%ac%ec%9a%a9%ed%95%9c-%ec%ba%90%ec%8b%b1-%ec%b2%98","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/41104\/","title":{"rendered":"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120"},"content":{"rendered":"<p><body><\/p>\n<p>\ud604\ub300 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc131\ub2a5\uc740 \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uacb0\uc815\uc9d3\ub294 \ud575\uc2ec \uc694\uc18c \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uc131\ub2a5\uc744 \uac1c\uc120\ud558\uae30 \uc704\ud55c \uc5ec\ub7ec \uac00\uc9c0 \ubc29\ubc95 \uc911 API \uce90\uc2f1\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4. \uc774\ubc88 \uae00\uc5d0\uc11c\ub294 Next.js\uc640 Nest.js\ub97c \ud65c\uc6a9\ud55c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c API \uce90\uc2f1\uc744 \uc5b4\ub5bb\uac8c \uad6c\ud604\ud560 \uc218 \uc788\ub294\uc9c0, \uadf8\ub9ac\uace0 Redis\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc131\ub2a5\uc744 \uac1c\uc120\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>1. API \uce90\uc2f1\uc758 \ud544\uc694\uc131<\/h2>\n<p>API \ud638\ucd9c\uc740 \ub124\ud2b8\uc6cc\ud06c\ub97c \ud1b5\ud574 \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\uae30 \ub54c\ubb38\uc5d0 \uc0c1\ub300\uc801\uc73c\ub85c \uc2dc\uac04\uc774 \uac78\ub9ac\ub294 \uc791\uc5c5\uc785\ub2c8\ub2e4. \uc774\ub97c \ucd5c\uc18c\ud654\ud558\uae30 \uc704\ud574 API \ud638\ucd9c \uacb0\uacfc\ub97c \uce90\uc2f1\ud558\uba74, \ub3d9\uc77c\ud55c \ub370\uc774\ud130\ub97c \uc5ec\ub7ec \ubc88 \uc694\uccad\ud560 \ud544\uc694\uac00 \uc5c6\uc5b4\uc838 \uc131\ub2a5\uc744 \ub300\ud3ed \ud5a5\uc0c1\uc2dc\ud0ac \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<ul>\n<li><strong>\uc11c\ubc84 \ubd80\ud558 \uac10\uc18c:<\/strong> \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub098 \uc678\ubd80 API\uc5d0 \ub300\ud55c \uc694\uccad\uc774 \uc904\uc5b4\ub4ed\ub2c8\ub2e4.<\/li>\n<li><strong>\uc751\ub2f5 \uc2dc\uac04 \ub2e8\ucd95:<\/strong> \uce90\uc2dc\ub41c \ub370\uc774\ud130\ub97c \uba54\ubaa8\ub9ac\uc5d0\uc11c \uc989\uc2dc \ubc18\ud658\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li><strong>\uc2a4\ucf00\uc77c\ub9c1 \uc6a9\uc774:<\/strong> \ub192\uc740 \ud2b8\ub798\ud53d\uc744 \ud6a8\uc728\uc801\uc73c\ub85c \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h2>2. Next.js\uc640 API \uce90\uc2f1<\/h2>\n<p>Next.js\ub294 React \uae30\ubc18\uc758 \ud504\ub808\uc784\uc6cc\ud06c\ub85c \uc11c\ubc84 \uce21 \ub80c\ub354\ub9c1(SSR)\uacfc \uc815\uc801 \uc0ac\uc774\ud2b8 \uc0dd\uc131(SSG)\uc744 \uc9c0\uc6d0\ud569\ub2c8\ub2e4. API \uc694\uccad\uc5d0 \ub300\ud55c \uce90\uc2f1\uc740 \ud074\ub77c\uc774\uc5b8\ud2b8 \uce21\uc5d0\uc11c\ub3c4, \uc11c\ubc84 \uce21\uc5d0\uc11c\ub3c4 \uac00\ub2a5\ud569\ub2c8\ub2e4.<\/p>\n<h3>2.1 \ud074\ub77c\uc774\uc5b8\ud2b8 \uce21\uc758 \ub370\uc774\ud130 \ud328\uce6d<\/h3>\n<p>Next.js\uc5d0\uc11c\ub294 <code>getStaticProps<\/code> \ubc0f <code>getServerSideProps<\/code>\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \ud328\uce6d\ud569\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 SSR\uc774\ub098 SSG\ub97c \ud65c\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uce90\uc2f1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc544\ub798\uc758 \ucf54\ub4dc\ub294 <code>getStaticProps<\/code>\ub97c \uc0ac\uc6a9\ud558\ub294 \uc608\uc2dc\uc785\ub2c8\ub2e4.<\/p>\n<pre><code>export async function getStaticProps() {\n    const res = await fetch('https:\/\/api.example.com\/data');\n    const data = await res.json();\n\n    return {\n        props: { data }, \/\/ \ub370\uc774\ud130\ub97c props\ub85c \uc804\ub2ec\n        revalidate: 60, \/\/ 60\ucd08\ub9c8\ub2e4 \ub370\uc774\ud130 \uc7ac\uac80\uc99d\n    };\n}<\/code><\/pre>\n<p>\uc704\uc758 \uc608\uc5d0\uc11c\ub294 60\ucd08\ub9c8\ub2e4 API\ub97c \uc7ac\uac80\uc99d\ud558\ubbc0\ub85c, \uc77c\uc815 \uc2dc\uac04 \ub3d9\uc548\uc5d4 \uce90\uc2dc\ub41c \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\uac8c \ub429\ub2c8\ub2e4.<\/p>\n<h3>2.2 \uc11c\ubc84 \uce21 API \uce90\uc2f1<\/h3>\n<p>Next.js API Routes\ub97c \uc774\uc6a9\ud558\uc5ec \uc11c\ubc84 \uce21\uc5d0\uc11c API\ub97c \ud638\ucd9c\ud558\uace0 \uce90\uc2f1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \uacbd\uc6b0 Redis\uc640 \uac19\uc740 \uc778\uba54\ubaa8\ub9ac \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ud65c\uc6a9\ud558\uba74 \uc131\ub2a5\uc744 \ub354\uc6b1 \uac1c\uc120\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>import Redis from 'ioredis';\n\nconst redis = new Redis();\n\nexport default async function handler(req, res) {\n    const cacheKey = 'my-data';\n\n    \/\/ Redis\uc5d0\uc11c \ub370\uc774\ud130 \uac00\uc838\uc624\uae30\n    const cachedData = await redis.get(cacheKey);\n    if (cachedData) {\n        return res.status(200).json(JSON.parse(cachedData));\n    }\n\n    \/\/ \uce90\uc2dc \ubbf8\uc2a4 \uc2dc API \ud638\ucd9c\n    const response = await fetch('https:\/\/api.example.com\/data');\n    const data = await response.json();\n\n    \/\/ \ub370\uc774\ud130 \uce90\uc2f1\n    await redis.set(cacheKey, JSON.stringify(data), 'EX', 60); \/\/ 60\ucd08 \ub3d9\uc548 \uce90\uc2f1\n\n    return res.status(200).json(data);\n}<\/code><\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 API\ub97c \uc694\uccad\ud560 \ub54c Redis\uc5d0\uc11c \uba3c\uc800 \uce90\uc2dc\ub41c \ub370\uc774\ud130\ub97c \ud655\uc778\ud558\uace0, \uce90\uc2dc\uac00 \uc5c6\uc744 \uacbd\uc6b0 API\ub97c \ud638\ucd9c\ud558\uc5ec \ub370\uc774\ud130\ub97c \uac00\uc838\uc628 \ud6c4 \uce90\uc2dc\ud569\ub2c8\ub2e4.<\/p>\n<h2>3. Nest.js\uc640 API \uce90\uc2f1<\/h2>\n<p>Nest.js\ub294 Express \uae30\ubc18\uc758 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API \uc11c\ubc84\ub97c \uad6c\ucd95\ud560 \ub54c \uc5ec\ub7ec \ubaa8\ub4c8\uacfc \ub370\ucf54\ub808\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\uc5ec \uad6c\uc870\ud654\ub41c \ucf54\ub4dc\ub97c \uc791\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Nest.js\uc5d0\uc11c\ub3c4 Redis\ub97c \uc774\uc6a9\ud55c API \uce90\uc2f1\uc744 \uc27d\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>3.1 Redis \ubaa8\ub4c8 \uc124\uce58<\/h3>\n<p>\uba3c\uc800 Redis \ud074\ub77c\uc774\uc5b8\ud2b8\ub97c \uc124\uce58\ud569\ub2c8\ub2e4. \uc544\ub798\uc758 \uba85\ub839\uc5b4\ub85c \uc124\uce58\ud574 \uc8fc\uc138\uc694.<\/p>\n<pre><code>npm install --save redis ioredis<\/code><\/pre>\n<h3>3.2 \uce90\uc2f1\uc744 \uc704\ud55c \uc11c\ube44\uc2a4 \uc0dd\uc131<\/h3>\n<p>Nest.js\uc5d0\uc11c\ub294 \uc11c\ube44\uc2a4\ub97c \uc0dd\uc131\ud558\uc5ec Redis\uc640\uc758 \uc778\ud130\ud398\uc774\uc2a4\ub97c \uad00\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>import { Injectable, Cacheable, CachePut } from '@nestjs\/common';\nimport { Redis } from 'ioredis';\n\n@Injectable()\nexport class CacheService {\n    private redis: Redis;\n\n    constructor() {\n        this.redis = new Redis();\n    }\n\n    async getCache(key: string) {\n        const data = await this.redis.get(key);\n        return data ? JSON.parse(data) : null;\n    }\n\n    async setCache(key: string, value: any, expiration: number) {\n        await this.redis.set(key, JSON.stringify(value), 'EX', expiration);\n    }\n}<\/code><\/pre>\n<p>\uc704\uc758 <code>CacheService<\/code> \ud074\ub798\uc2a4\ub294 Redis\uc5d0\uc11c \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\uace0 \uc124\uc815\ud558\ub294 \uba54\uc11c\ub4dc\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.<\/p>\n<h3>3.3 \uce90\uc2f1\uc744 \uc801\uc6a9\ud55c \ucee8\ud2b8\ub864\ub7ec<\/h3>\n<p>\ucee8\ud2b8\ub864\ub7ec\uc5d0\uc11c \uc11c\ube44\uc2a4\ub97c \uc774\uc6a9\ud558\uc5ec \uce90\uc2f1\uc744 \uad6c\ud604\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>import { Controller, Get } from '@nestjs\/common';\nimport { CacheService } from '.\/cache.service';\n\n@Controller('data')\nexport class DataController {\n    constructor(private readonly cacheService: CacheService) {}\n\n    @Get()\n    async getData() {\n        const cacheKey = 'api:data';\n        \n        \/\/ \uce90\uc2dc\uc5d0\uc11c \ub370\uc774\ud130 \ud655\uc778\n        const cachedData = await this.cacheService.getCache(cacheKey);\n        if (cachedData) {\n            return cachedData;\n        }\n\n        \/\/ \uce90\uc2dc \ubbf8\uc2a4 \uc2dc API \ud638\ucd9c\n        const response = await fetch('https:\/\/api.example.com\/data');\n        const data = await response.json();\n\n        \/\/ \ub370\uc774\ud130 \uce90\uc2f1\n        await this.cacheService.setCache(cacheKey, data, 60); \/\/ 60\ucd08 \ub3d9\uc548 \uce90\uc2f1\n\n        return data;\n    }\n}<\/code><\/pre>\n<p>\uc704\uc758 \uc608\uc5d0\uc11c\ub294 Nest.js \ucee8\ud2b8\ub864\ub7ec\uc5d0\uc11c API \uc694\uccad\uc744 \ucc98\ub9ac\ud558\uace0, Redis\ub97c \ud1b5\ud574 \uce90\uc2f1\uc744 \uad00\ub9ac\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>4. Redis\ub97c \ud65c\uc6a9\ud55c \uc131\ub2a5 \uac1c\uc120<\/h2>\n<p>Redis\ub294 \uc778\uba54\ubaa8\ub9ac \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub85c \ub9e4\uc6b0 \ube60\ub978 \ub370\uc774\ud130 \uc77d\uae30\uc640 \uc4f0\uae30 \uc18d\ub3c4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. \ub610\ud55c, \ub370\uc774\ud130 \uad6c\uc870\uac00 \ub2e4\uc591\ud558\uc5ec \uc5ec\ub7ec \ud615\ud0dc\uc758 \ub370\uc774\ud130\ub97c \uc27d\uac8c \uad00\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\uc5d0 \ub530\ub77c Redis\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc131\ub2a5\uc744 \ucd5c\uc801\ud654\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>4.1 \ub370\uc774\ud130 \uad6c\uc870<\/h3>\n<p>Redis\ub294 \ubb38\uc790\uc5f4, \ud574\uc2dc, \ub9ac\uc2a4\ud2b8, \uc14b \ub4f1 \ub2e4\uc591\ud55c \ub370\uc774\ud130 \uad6c\uc870\ub97c \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \uc801\uc808\ud55c \ub370\uc774\ud130 \uad6c\uc870\ub97c \uc120\ud0dd\ud558\uc5ec \uce90\uc2dc \uc131\ub2a5\uc744 \ucd5c\uc801\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<ul>\n<li><strong>\ubb38\uc790\uc5f4:<\/strong> \uac04\ub2e8\ud55c \uce90\uc2f1\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>\ud574\uc2dc:<\/strong> \uac1d\uccb4 \ud615\ud0dc\uc758 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud560 \ub54c \uc720\uc6a9\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>\ub9ac\uc2a4\ud2b8:<\/strong> \uc815\ub82c\ub41c \ub370\uc774\ud130 \ubaa9\ub85d\uc744 \uad00\ub9ac\ud560 \ub54c \uc88b\uc2b5\ub2c8\ub2e4.<\/li>\n<li><strong>\uc14b:<\/strong> \uc911\ubcf5\ub418\uc9c0 \uc54a\ub294 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ub370 \uc720\ub9ac\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h3>4.2 TTL(Time-To-Live) \uc124\uc815<\/h3>\n<p>\uce90\uc2dc\ub41c \ub370\uc774\ud130\uc758 \uc0dd\uba85 \uc8fc\uae30\ub97c \uc124\uc815\ud558\ub294 \uac83\uc740 \ub9e4\uc6b0 \uc911\uc694\ud569\ub2c8\ub2e4. TTL\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub354 \uc774\uc0c1 \ud544\uc694\ud558\uc9c0 \uc54a\uc740 \uce90\uc2dc \ub370\uc774\ud130\ub97c \uc790\ub3d9\uc73c\ub85c \uc81c\uac70\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub294 \uba54\ubaa8\ub9ac \uc0ac\uc6a9\ub7c9\uc744 \uc904\uc774\uace0, \uc624\ub798\ub41c \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\uc9c0 \uc54a\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4.<\/p>\n<h3>4.3 \uce90\uc2f1 \uc804\ub7b5<\/h3>\n<p>\ud6a8\uc728\uc801\uc778 \uce90\uc2f1 \uc804\ub7b5\uc744 \uc218\ub9bd\ud558\ub294 \uac83\uc774 \uc911\uc694\ud569\ub2c8\ub2e4. \ub2e4\uc74c\uacfc \uac19\uc740 \uae30\ubcf8\uc801\uc778 \uce90\uc2f1 \uc804\ub7b5\uc744 \uace0\ub824\ud574 \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<ul>\n<li><strong>\uc815\uc801 \uce90\uc2f1:<\/strong> \ubcc0\ud654\uac00 \uc801\uc740 \ub370\uc774\ud130\uc5d0 \ub300\ud574 \uce90\uc2f1\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>\ub3d9\uc801 \uce90\uc2f1:<\/strong> \uc8fc\uae30\uc801\uc73c\ub85c \uc5c5\ub370\uc774\ud2b8\ub418\ub294 \ub370\uc774\ud130\ub97c \uce90\uc2f1\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>\ubd80\ubd84 \uce90\uc2f1:<\/strong> \uc804\uccb4 \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\uc9c0 \uc54a\uace0 \ud544\uc694\ud55c \ubd80\ubd84\ub9cc \uce90\uc2f1\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h2>5. \uacb0\ub860<\/h2>\n<p>Next.js\uc640 Nest.js\ub97c \ud65c\uc6a9\ud558\uc5ec API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654\ub97c \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uc558\uc2b5\ub2c8\ub2e4. Redis\ub97c \uc774\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\ub294 \ube60\ub978 \ub370\uc774\ud130 \uc811\uadfc\uacfc \ub192\uc740 \uc131\ub2a5\uc744 \ubcf4\uc7a5\ud569\ub2c8\ub2e4. \ub530\ub77c\uc11c, \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uad6c\uc870\uc5d0 \ub9de\ub294 \uc801\uc808\ud55c \uce90\uc2f1 \uc804\ub7b5\uc744 \uc218\ub9bd\ud558\ub294 \uac83\uc774 \uc911\uc694\ud569\ub2c8\ub2e4. \ucd5c\uc801\ud654\ub41c API\ub97c \ud1b5\ud574 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ucf8c\uc801\ud55c \uacbd\ud5d8\uc744 \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \uc5ec\ub7ec\ubd84\uc740 Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uc744 \uad6c\ud604\ud558\uace0 Redis\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc131\ub2a5\uc744 \uac1c\uc120\ud558\ub294 \ubc29\ubc95\uc744 \ucda9\ubd84\ud788 \uc774\ud574\ud558\uac8c \ub418\uc5c8\uc2b5\ub2c8\ub2e4. \uc774 \uae00\uc744 \ud1b5\ud574 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uc131\ub2a5 \ucd5c\uc801\ud654\uc5d0 \ud070 \ub3c4\uc6c0\uc744 \ubc1b\uc744 \uc218 \uc788\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud604\ub300 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc131\ub2a5\uc740 \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uacb0\uc815\uc9d3\ub294 \ud575\uc2ec \uc694\uc18c \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uc131\ub2a5\uc744 \uac1c\uc120\ud558\uae30 \uc704\ud55c \uc5ec\ub7ec \uac00\uc9c0 \ubc29\ubc95 \uc911 API \uce90\uc2f1\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4. \uc774\ubc88 \uae00\uc5d0\uc11c\ub294 Next.js\uc640 Nest.js\ub97c \ud65c\uc6a9\ud55c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c API \uce90\uc2f1\uc744 \uc5b4\ub5bb\uac8c \uad6c\ud604\ud560 \uc218 \uc788\ub294\uc9c0, \uadf8\ub9ac\uace0 Redis\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc131\ub2a5\uc744 \uac1c\uc120\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4. 1. API \uce90\uc2f1\uc758 \ud544\uc694\uc131 API \ud638\ucd9c\uc740 \ub124\ud2b8\uc6cc\ud06c\ub97c \ud1b5\ud574 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/41104\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[223],"tags":[],"class_list":["post-41104","post","type-post","status-publish","format-standard","hentry","category-nextjs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/41104\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\ud604\ub300 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc131\ub2a5\uc740 \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uacb0\uc815\uc9d3\ub294 \ud575\uc2ec \uc694\uc18c \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uc131\ub2a5\uc744 \uac1c\uc120\ud558\uae30 \uc704\ud55c \uc5ec\ub7ec \uac00\uc9c0 \ubc29\ubc95 \uc911 API \uce90\uc2f1\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4. \uc774\ubc88 \uae00\uc5d0\uc11c\ub294 Next.js\uc640 Nest.js\ub97c \ud65c\uc6a9\ud55c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c API \uce90\uc2f1\uc744 \uc5b4\ub5bb\uac8c \uad6c\ud604\ud560 \uc218 \uc788\ub294\uc9c0, \uadf8\ub9ac\uace0 Redis\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc131\ub2a5\uc744 \uac1c\uc120\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4. 1. API \uce90\uc2f1\uc758 \ud544\uc694\uc131 API \ud638\ucd9c\uc740 \ub124\ud2b8\uc6cc\ud06c\ub97c \ud1b5\ud574 &hellip; \ub354 \ubcf4\uae30 &quot;43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/41104\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-06T02:46:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:37:34+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/41104\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/41104\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120\",\"datePublished\":\"2024-11-06T02:46:35+00:00\",\"dateModified\":\"2024-11-26T06:37:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/41104\/\"},\"wordCount\":82,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"nextjs\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/41104\/\",\"url\":\"https:\/\/atmokpo.com\/w\/41104\/\",\"name\":\"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-06T02:46:35+00:00\",\"dateModified\":\"2024-11-26T06:37:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/41104\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/41104\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/41104\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/41104\/","og_locale":"ko_KR","og_type":"article","og_title":"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\ud604\ub300 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc131\ub2a5\uc740 \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uacb0\uc815\uc9d3\ub294 \ud575\uc2ec \uc694\uc18c \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uc131\ub2a5\uc744 \uac1c\uc120\ud558\uae30 \uc704\ud55c \uc5ec\ub7ec \uac00\uc9c0 \ubc29\ubc95 \uc911 API \uce90\uc2f1\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4. \uc774\ubc88 \uae00\uc5d0\uc11c\ub294 Next.js\uc640 Nest.js\ub97c \ud65c\uc6a9\ud55c \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c API \uce90\uc2f1\uc744 \uc5b4\ub5bb\uac8c \uad6c\ud604\ud560 \uc218 \uc788\ub294\uc9c0, \uadf8\ub9ac\uace0 Redis\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc131\ub2a5\uc744 \uac1c\uc120\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4. 1. API \uce90\uc2f1\uc758 \ud544\uc694\uc131 API \ud638\ucd9c\uc740 \ub124\ud2b8\uc6cc\ud06c\ub97c \ud1b5\ud574 &hellip; \ub354 \ubcf4\uae30 \"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120\"","og_url":"https:\/\/atmokpo.com\/w\/41104\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-06T02:46:35+00:00","article_modified_time":"2024-11-26T06:37:34+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"1\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/41104\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/41104\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120","datePublished":"2024-11-06T02:46:35+00:00","dateModified":"2024-11-26T06:37:34+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/41104\/"},"wordCount":82,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["nextjs"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/41104\/","url":"https:\/\/atmokpo.com\/w\/41104\/","name":"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-06T02:46:35+00:00","dateModified":"2024-11-26T06:37:34+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/41104\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/41104\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/41104\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"43.Next.js\uc640 Nest.js\uc5d0\uc11c API \uce90\uc2f1\uacfc \uc131\ub2a5 \ucd5c\uc801\ud654, Redis\ub97c \uc0ac\uc6a9\ud55c \uce90\uc2f1 \ucc98\ub9ac\uc640 \uc131\ub2a5 \uac1c\uc120"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/41104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=41104"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/41104\/revisions"}],"predecessor-version":[{"id":41105,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/41104\/revisions\/41105"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=41104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=41104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=41104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}