{"id":41064,"date":"2024-11-06T02:46:27","date_gmt":"2024-11-06T02:46:27","guid":{"rendered":"https:\/\/atmokpo.com\/w\/?p=41064"},"modified":"2024-11-26T06:37:41","modified_gmt":"2024-11-26T06:37:41","slug":"13-next-js%ec%99%80-nest-js-%ec%97%b0%eb%8f%99%ed%95%98%ec%97%ac-%eb%8d%b0%ec%9d%b4%ed%84%b0-%ea%b0%80%ec%a0%b8%ec%98%a4%ea%b8%b0-next-js%ec%97%90%ec%84%9c-api-%eb%8d%b0%ec%9d%b4%ed%84%b0-%ea%b0%80","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/41064\/","title":{"rendered":"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR)"},"content":{"rendered":"<p><body><\/p>\n<article>\n<p>\n            \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \uc788\uc5b4 \uc11c\ubc84 \uc0ac\uc774\ub4dc \ub80c\ub354\ub9c1(SSR)\uacfc API\uc758 \ud6a8\uc728\uc801\uc778 \uc0ac\uc6a9\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc694\uc18c\uc785\ub2c8\ub2e4.<br \/>\n            <a href=\"https:\/\/nextjs.org\/\">Next.js<\/a>\ub294 React \uae30\ubc18\uc758 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc11c\ubc84 \uc0ac\uc774\ub4dc \ub80c\ub354\ub9c1\uc744 \uc9c0\uc6d0\ud558\uba74\uc11c<br \/>\n            \ub6f0\uc5b4\ub09c \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uc81c\uacf5\ud558\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \ud55c\ud3b8, <a href=\"https:\/\/nestjs.com\/\">Nest.js<\/a>\ub294<br \/>\n            \ud6a8\uc728\uc801\uc774\uace0 \ud655\uc7a5 \uac00\ub2a5\ud558\uba70 \uc27d\uac8c \ud14c\uc2a4\ud2b8\ud560 \uc218 \uc788\ub294 Node.js \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ud504\ub808\uc784\uc6cc\ud06c\ub85c RESTful API\ub97c \uad6c\ucd95\ud558\ub294 \ub370\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4.<br \/>\n            \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 Next.js\uc640 Nest.js\ub97c \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\ub294 \ubc29\ubc95, \ud2b9\ud788 <code>getServerSideProps<\/code>\uc640 <code>SWR<\/code>\uc744 \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<h2>1. Nest.js API \uc11c\ubc84 \uc124\uc815\ud558\uae30<\/h2>\n<p>\n            \uba3c\uc800, Nest.js\ub85c \uac04\ub2e8\ud55c API \uc11c\ubc84\ub97c \uc124\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc0c8\ub85c\uc6b4 Nest.js \ud504\ub85c\uc81d\ud2b8\ub97c \uc0dd\uc131\ud558\uae30 \uc704\ud574 CLI\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br \/>\n            \uc124\uce58\uac00 \ub418\uc5b4 \uc788\uc9c0 \uc54a\ub2e4\uba74, \uc544\ub798 \uba85\ub839\uc5b4\ub85c Nest CLI\ub97c \uc124\uce58\ud569\ub2c8\ub2e4.\n        <\/p>\n<pre><code>npm install -g @nestjs\/cli<\/code><\/pre>\n<p>\n            \uadf8 \ud6c4, \uc0c8\ub85c\uc6b4 Nest.js \ud504\ub85c\uc81d\ud2b8\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.\n        <\/p>\n<pre><code>nest new blog-api<\/code><\/pre>\n<p>\n            \uc0dd\uc131\ub41c \ud504\ub85c\uc81d\ud2b8 \ub514\ub809\ud1a0\ub9ac\ub85c \uc774\ub3d9\ud558\uc5ec RESTful API\ub97c \uad6c\ud604\ud558\uae30 \uc704\ud574 \uc0c8\ub85c\uc6b4 \ubaa8\ub4c8\uacfc \ucee8\ud2b8\ub864\ub7ec\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4:\n        <\/p>\n<pre><code>nest generate module posts<\/code><\/pre>\n<pre><code>nest generate controller posts<\/code><\/pre>\n<p>\n            \ub2e4\uc74c\uc73c\ub85c, <code>PostsController<\/code>\uc5d0 GET \uc694\uccad\uc744 \ucc98\ub9ac\ud558\ub294 \uba54\uc11c\ub4dc\ub97c \ucd94\uac00\ud558\uaca0\uc2b5\ub2c8\ub2e4. <code>src\/posts\/posts.controller.ts<\/code> \ud30c\uc77c\uc744 \uc5f4\uc5b4<br \/>\n            \ub2e4\uc74c\uacfc \uac19\uc774 \uad6c\ud604\ud569\ub2c8\ub2e4.\n        <\/p>\n<pre><code>\nimport { Controller, Get } from '@nestjs\/common';\n\n@Controller('posts')\nexport class PostsController {\n    @Get()\n    findAll() {\n        return [\n            { id: 1, title: '\uccab \ubc88\uc9f8 \uac8c\uc2dc\uae00', content: '\uc774\uac83\uc740 \uccab \ubc88\uc9f8 \uac8c\uc2dc\uae00\uc758 \ub0b4\uc6a9\uc785\ub2c8\ub2e4.' },\n            { id: 2, title: '\ub450 \ubc88\uc9f8 \uac8c\uc2dc\uae00', content: '\uc774\uac83\uc740 \ub450 \ubc88\uc9f8 \uac8c\uc2dc\uae00\uc758 \ub0b4\uc6a9\uc785\ub2c8\ub2e4.' },\n        ];\n    }\n}\n        <\/code><\/pre>\n<p>\n            \uc774\uc81c Nest.js \uc11c\ubc84\ub97c \uc2e4\ud589\ud558\uc5ec API\ub97c \ud655\uc778\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<pre><code>npm run start<\/code><\/pre>\n<p>\n            \uae30\ubcf8\uc801\uc73c\ub85c <code>localhost:3000\/posts<\/code>\uc5d0\uc11c \uac8c\uc2dc\uae00\uc744 \ubd88\ub7ec\uc62c \uc218 \uc788\ub294 API\uac00 \uc900\ube44\ub418\uc5c8\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<h2>2. Next.js \uc124\uc815\ud558\uae30<\/h2>\n<p>\n            \uc774\uc81c Next.js \ud504\ub85c\uc81d\ud2b8\ub97c \uc0dd\uc131\ud558\uc5ec Nest.js API\uc5d0\uc11c \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<br \/>\n            \uc0c8\ub85c\uc6b4 Next.js \ud504\ub85c\uc81d\ud2b8\ub97c \uc0dd\uc131\ud558\uae30 \uc704\ud574 \uc544\ub798 \uba85\ub839\uc5b4\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4.\n        <\/p>\n<pre><code>npx create-next-app blog-client<\/code><\/pre>\n<p>\n            \ud504\ub85c\uc81d\ud2b8 \ub514\ub809\ud1a0\ub9ac\ub85c \uc774\ub3d9 \ud6c4, \ud544\uc694\ud55c \ud328\ud0a4\uc9c0\ub97c \uc124\uce58\ud569\ub2c8\ub2e4.\n        <\/p>\n<pre><code>cd blog-client<\/code><\/pre>\n<pre><code>npm install swr<\/code><\/pre>\n<p>\n            Next.js \ud398\uc774\uc9c0\uc5d0\uc11c API \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\ub294 \ub450 \uac00\uc9c0 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4: <code>getServerSideProps<\/code>\uc640 <code>SWR<\/code>.\n        <\/p>\n<h2>3. getServerSideProps\ub97c \uc774\uc6a9\ud55c \ub370\uc774\ud130 \uac00\uc838\uc624\uae30<\/h2>\n<p>\n<code>getServerSideProps<\/code>\ub294 Next.js\uc5d0\uc11c \ud398\uc774\uc9c0\uac00 \uc694\uccad\ub420 \ub54c\ub9c8\ub2e4 \uc11c\ubc84\uc5d0\uc11c \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\ub294 \uba54\uc11c\ub4dc\uc785\ub2c8\ub2e4.<br \/>\n            \uc774 \uba54\uc11c\ub4dc\ub294 \ud398\uc774\uc9c0 \ucef4\ud3ec\ub10c\ud2b8\uc758 \ud504\ub85c\ud37c\ud2f0\uc5d0 \ub370\uc774\ud130\ub97c \uc8fc\uc785\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4.\n        <\/p>\n<pre><code>\nexport async function getServerSideProps() {\n    const res = await fetch('http:\/\/localhost:3000\/posts');\n    const posts = await res.json();\n\n    return {\n        props: {\n            posts,\n        },\n    };\n}\n        <\/code><\/pre>\n<p>\n            \uc704\uc640 \uac19\uc740 \ubc29\uc2dd\uc73c\ub85c \ub370\uc774\ud130\ub97c \uac00\uc838\uc628 \ud6c4, \ud398\uc774\uc9c0\uc5d0\uc11c \uc544\ub798\uc640 \uac19\uc774 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<pre><code>\nimport React from 'react';\n\nconst PostsPage = ({ posts }) =&gt; {\n    return (\n        <div>\n            <h1>\uac8c\uc2dc\uae00 \ubaa9\ub85d<\/h1>\n            <ul>\n                {posts.map(post =&gt; (\n                    <li key=\"{post.id}\">{post.title}<\/li>\n                ))}\n            <\/ul>\n        <\/div>\n    );\n};\n\nexport default PostsPage;\n        <\/code><\/pre>\n<p>\n            \uc774 \ucf54\ub4dc\ub294 Nest API\ub85c\ubd80\ud130 \uac00\uc838\uc628 \uac8c\uc2dc\uae00 \ubaa9\ub85d\uc744 \ub80c\ub354\ub9c1\ud569\ub2c8\ub2e4. <code>getServerSideProps<\/code>\ub97c \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0,<br \/>\n            \ud398\uc774\uc9c0\uac00 \uc694\uccad\ub420 \ub54c\ub9c8\ub2e4 \ud56d\uc0c1 \ucd5c\uc2e0 \ub370\uc774\ud130\ub97c \uac00\uc838\uc635\ub2c8\ub2e4.\n        <\/p>\n<h2>4. SWR\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30<\/h2>\n<p>\n<code>SWR<\/code>\uc740 \ub370\uc774\ud130 \ud328\uce6d\uc744 \uc704\ud55c React \ud6c5\uc73c\ub85c, \ub2e4\uc591\ud55c \ub370\uc774\ud130 \uc694\uccad\uc744 \uce90\uc2f1\ud558\uc5ec \ub354 \ub098\uc740 \uc131\ub2a5\uacfc \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.<br \/>\n            SWR\uc740 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uc11c \ub370\uc774\ud130\ub97c \ud328\uce6d\ud560 \ub54c \uc8fc\uae30\uc801\uc73c\ub85c \ub370\uc774\ud130\ub97c \uc5c5\ub370\uc774\ud2b8\ud558\uace0, \uc7ac\uac80\uc99d\ud558\ub294 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.\n        <\/p>\n<pre><code>\nimport useSWR from 'swr';\n\nconst fetcher = (url) =&gt; fetch(url).then(res =&gt; res.json());\n\nconst PostsPage = () =&gt; {\n    const { data, error } = useSWR('http:\/\/localhost:3000\/posts', fetcher);\n\n    if (error) return <div>\uc5d0\ub7ec \ubc1c\uc0dd<\/div>;\n    if (!data) return <div>\ub85c\ub529 \uc911...<\/div>;\n\n    return (\n        <div>\n            <h1>\uac8c\uc2dc\uae00 \ubaa9\ub85d<\/h1>\n            <ul>\n                {data.map(post =&gt; (\n                    <li key=\"{post.id}\">{post.title}<\/li>\n                ))}\n            <\/ul>\n        <\/div>\n    );\n};\n\nexport default PostsPage;\n        <\/code><\/pre>\n<p>\n            \uc704 \ucf54\ub4dc\uc5d0\uc11c\ub294 <code>useSWR<\/code>\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\uace0, \ub85c\ub529 \uc911\uc77c \ub54c\uc640 \uc5d0\ub7ec \ubc1c\uc0dd \uc2dc\uc758 \uc0c1\ud0dc\ub97c \ucc98\ub9ac\ud569\ub2c8\ub2e4.<br \/>\n            \uc774\ub807\uac8c \ud558\uba74 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ub354 \ub098\uc740 \uacbd\ud5d8\uc744 \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<h2>5. \uacb0\ub860<\/h2>\n<p>\n            \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 Nest.js\ub85c API \uc11c\ubc84\ub97c \uad6c\ucd95\ud558\uace0, Next.js\uc5d0\uc11c <code>getServerSideProps<\/code>\uc640 <code>SWR<\/code>\uc744 \ud1b5\ud574 API \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4.<br \/>\n            Nest.js\uc640 Next.js\ub97c \uc870\ud569\ud558\uc5ec \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ud6a8\uc728\uc801\uc73c\ub85c \uac1c\ubc1c\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uc558\uc73c\uba70, \uac01\uac01\uc758 \ubc29\ubc95\uc774 \uac00\uc9c0\ub294 \ud2b9\uc131\uacfc \uc0ac\uc6a9 \uc0ac\ub840\ub97c \uc774\ud574\ud560 \uc218 \uc788\uc5c8\uc2b5\ub2c8\ub2e4.<br \/>\n            \uc774\ub7ec\ud55c \uae30\uc220\ub4e4\uc740 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uc131\ub2a5\uacfc \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \ud68d\uae30\uc801\uc73c\ub85c \uac1c\uc120\ud558\ub294 \ub370\uc5d0 \uae30\uc5ec\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n        <\/p>\n<p>\n            \uc774\ub97c \ud1b5\ud574 \uc6d0\ud558\ub294 \ub370\uc774\ud130 \ud328\uce6d \ubc29\uc2dd\uacfc \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uace0\ub824\ud558\uc5ec \uc801\uc808\ud55c \ubc29\ubc95\uc744 \uc120\ud0dd\ud558\uba74 \uc88b\uc744 \uac83\uc785\ub2c8\ub2e4.<br \/>\n            Next.js\uc640 Nest.js\uc758 \uc870\ud569\uc740 \uac1c\ubc1c\uc790\uc5d0\uac8c \uac15\ub825\ud55c \ub3c4\uad6c\uac00 \ub418\uc5b4 \uc8fc\uba70, \ub354 \ub098\uc740 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4e4\uae30 \uc704\ud55c \uae30\ubc18\uc774 \ub420 \uac83\uc785\ub2c8\ub2e4.\n        <\/p>\n<\/article>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \uc788\uc5b4 \uc11c\ubc84 \uc0ac\uc774\ub4dc \ub80c\ub354\ub9c1(SSR)\uacfc API\uc758 \ud6a8\uc728\uc801\uc778 \uc0ac\uc6a9\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc694\uc18c\uc785\ub2c8\ub2e4. Next.js\ub294 React \uae30\ubc18\uc758 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc11c\ubc84 \uc0ac\uc774\ub4dc \ub80c\ub354\ub9c1\uc744 \uc9c0\uc6d0\ud558\uba74\uc11c \ub6f0\uc5b4\ub09c \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uc81c\uacf5\ud558\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \ud55c\ud3b8, Nest.js\ub294 \ud6a8\uc728\uc801\uc774\uace0 \ud655\uc7a5 \uac00\ub2a5\ud558\uba70 \uc27d\uac8c \ud14c\uc2a4\ud2b8\ud560 \uc218 \uc788\ub294 Node.js \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ud504\ub808\uc784\uc6cc\ud06c\ub85c RESTful API\ub97c \uad6c\ucd95\ud558\ub294 \ub370\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 Next.js\uc640 Nest.js\ub97c \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\ub294 \ubc29\ubc95, \ud2b9\ud788 getServerSideProps\uc640 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/41064\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR)&#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-41064","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>13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR) - \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\/41064\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \uc788\uc5b4 \uc11c\ubc84 \uc0ac\uc774\ub4dc \ub80c\ub354\ub9c1(SSR)\uacfc API\uc758 \ud6a8\uc728\uc801\uc778 \uc0ac\uc6a9\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc694\uc18c\uc785\ub2c8\ub2e4. Next.js\ub294 React \uae30\ubc18\uc758 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc11c\ubc84 \uc0ac\uc774\ub4dc \ub80c\ub354\ub9c1\uc744 \uc9c0\uc6d0\ud558\uba74\uc11c \ub6f0\uc5b4\ub09c \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uc81c\uacf5\ud558\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \ud55c\ud3b8, Nest.js\ub294 \ud6a8\uc728\uc801\uc774\uace0 \ud655\uc7a5 \uac00\ub2a5\ud558\uba70 \uc27d\uac8c \ud14c\uc2a4\ud2b8\ud560 \uc218 \uc788\ub294 Node.js \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ud504\ub808\uc784\uc6cc\ud06c\ub85c RESTful API\ub97c \uad6c\ucd95\ud558\ub294 \ub370\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 Next.js\uc640 Nest.js\ub97c \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\ub294 \ubc29\ubc95, \ud2b9\ud788 getServerSideProps\uc640 &hellip; \ub354 \ubcf4\uae30 &quot;13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR)&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/41064\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-06T02:46:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:37:41+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\/41064\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/41064\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR)\",\"datePublished\":\"2024-11-06T02:46:27+00:00\",\"dateModified\":\"2024-11-26T06:37:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/41064\/\"},\"wordCount\":78,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"nextjs\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/41064\/\",\"url\":\"https:\/\/atmokpo.com\/w\/41064\/\",\"name\":\"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-06T02:46:27+00:00\",\"dateModified\":\"2024-11-26T06:37:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/41064\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/41064\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/41064\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR)\"}]},{\"@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":"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR) - \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\/41064\/","og_locale":"ko_KR","og_type":"article","og_title":"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc5d0 \uc788\uc5b4 \uc11c\ubc84 \uc0ac\uc774\ub4dc \ub80c\ub354\ub9c1(SSR)\uacfc API\uc758 \ud6a8\uc728\uc801\uc778 \uc0ac\uc6a9\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc694\uc18c\uc785\ub2c8\ub2e4. Next.js\ub294 React \uae30\ubc18\uc758 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \uc11c\ubc84 \uc0ac\uc774\ub4dc \ub80c\ub354\ub9c1\uc744 \uc9c0\uc6d0\ud558\uba74\uc11c \ub6f0\uc5b4\ub09c \uc0ac\uc6a9\uc790 \uacbd\ud5d8\uc744 \uc81c\uacf5\ud558\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \ud55c\ud3b8, Nest.js\ub294 \ud6a8\uc728\uc801\uc774\uace0 \ud655\uc7a5 \uac00\ub2a5\ud558\uba70 \uc27d\uac8c \ud14c\uc2a4\ud2b8\ud560 \uc218 \uc788\ub294 Node.js \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ud504\ub808\uc784\uc6cc\ud06c\ub85c RESTful API\ub97c \uad6c\ucd95\ud558\ub294 \ub370\uc5d0 \uc801\ud569\ud569\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 Next.js\uc640 Nest.js\ub97c \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uac00\uc838\uc624\ub294 \ubc29\ubc95, \ud2b9\ud788 getServerSideProps\uc640 &hellip; \ub354 \ubcf4\uae30 \"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR)\"","og_url":"https:\/\/atmokpo.com\/w\/41064\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-06T02:46:27+00:00","article_modified_time":"2024-11-26T06:37:41+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\/41064\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/41064\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR)","datePublished":"2024-11-06T02:46:27+00:00","dateModified":"2024-11-26T06:37:41+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/41064\/"},"wordCount":78,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["nextjs"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/41064\/","url":"https:\/\/atmokpo.com\/w\/41064\/","name":"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR) - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-06T02:46:27+00:00","dateModified":"2024-11-26T06:37:41+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/41064\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/41064\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/41064\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"13.Next.js\uc640 Nest.js \uc5f0\ub3d9\ud558\uc5ec \ub370\uc774\ud130 \uac00\uc838\uc624\uae30, Next.js\uc5d0\uc11c API \ub370\uc774\ud130 \uac00\uc838\uc624\ub294 \ubc29\ubc95 (getServerSideProps, SWR)"}]},{"@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\/41064","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=41064"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/41064\/revisions"}],"predecessor-version":[{"id":41065,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/41064\/revisions\/41065"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=41064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=41064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=41064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}