{"id":1898,"date":"2022-10-16T13:46:30","date_gmt":"2022-10-16T04:46:30","guid":{"rendered":"https:\/\/teno-hira.com\/media\/?p=1898"},"modified":"2022-10-16T13:46:30","modified_gmt":"2022-10-16T04:46:30","slug":"next-js%e3%82%92%e5%b0%91%e3%81%97%e3%81%9a%e3%81%a4%e7%90%86%e8%a7%a3%e3%81%97%e3%81%a6%e3%81%84%e3%81%8f14%e3%80%90ssrcsr%ef%bd%9cssgcsr%e3%80%91","status":"publish","type":"post","link":"https:\/\/teno-hira.com\/media\/?p=1898","title":{"rendered":"Next.js\u3092\u5c11\u3057\u305a\u3064\u7406\u89e3\u3057\u3066\u3044\u304f14\u3010SSR+CSR\uff5cSSG+CSR\u3011"},"content":{"rendered":"<p>\u4eca\u56de\u306fSSR\u3068CSR\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30c7\u30fc\u30bf\u3092\u30d5\u30a7\u30c3\u30c1\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>\u3053\u306e\u8a18\u4e8b\u3067\u3084\u308b\u3053\u3068<\/h2>\n<p>\u4eca\u56de\u306f\u30e6\u30fc\u30b6\u30fc\u306e\u64cd\u4f5c\u306b\u5fdc\u3058\u3066\u3001\u8868\u793a\u3059\u308b\u8a18\u4e8b\u4e00\u89a7\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u3092\u66f4\u65b0\u3067\u304d\u308b\u30da\u30fc\u30b8\u3092\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306b\u306f\u3001\u30da\u30fc\u30b8\u306e\u4e0a\u90e8\u306b\u7528\u610f\u3057\u305f\u30ab\u30c6\u30b4\u30ea\u9078\u629e\u30dc\u30bf\u30f3\u3092\u30e6\u30fc\u30b6\u30fc\u304c\u30af\u30ea\u30c3\u30af\u3057\u3001\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u30ab\u30c6\u30b4\u30ea\u306b\u5fdc\u3058\u3066CSR\u5074\u3067\u30c7\u30fc\u30bf\u3092\u30d5\u30a7\u30c3\u30c1\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u3088\u3046\u306a\u4ed5\u7d44\u307f\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u305d\u308c\u3060\u3051\u3060\u3068\u3001\u66f4\u65b0\u3055\u308c\u305f\u3069\u306e\u7a2e\u985e\u306e\u30ab\u30c6\u30b4\u30ea\u30da\u30fc\u30b8\u3067\u3082URL\u304c\u540c\u3058\u307e\u307e\u306b\u306a\u308a\u3001\u300c\u77e5\u4eba\u3068\u305d\u306e\u30da\u30fc\u30b8\u3092\u30b7\u30a7\u30a2\u3059\u308b\u300d\u3068\u3044\u3063\u305f\u3053\u3068\u304c\u3067\u304d\u306a\u304f\u306a\u308b\u306e\u3067\u3001URL\u3082\u66f4\u65b0\u3067\u304d\u308b\u3088\u3046\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>SSR\u3068CSR\u3092\u7d44\u307f\u5408\u308f\u305b\u308b<\/h2>\n<p>\u307e\u305a\u306f\u3001\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u4f7f\u7528\u3059\u308b\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>ISR\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u305f\u8a18\u4e8b\u3067\u3082\u4f7f\u7528\u3057\u305fjson-server\u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5229\u7528\u3057\u3066\u3001\u65b0\u305f\u306b\u30d5\u30a7\u30c3\u30c1\u3059\u308b\u30c7\u30fc\u30bf\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/teno-hira.com\/media\/?p=1768\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"360\" height=\"360\" alt=\"Next.js\u3092\u5c11\u3057\u305a\u3064\u7406\u89e3\u3057\u3066\u3044\u304f11\u3010ISR\/Incremental Static Regeneration\u3011\" loading=\"lazy\" data-src=\"https:\/\/teno-hira.com\/media\/wp-content\/uploads\/2022\/09\/undraw_next_js_8g5m-360x360.png\" class=\"lazyload\"><\/div><div class=\"title\">Next.js\u3092\u5c11\u3057\u305a\u3064\u7406\u89e3\u3057\u3066\u3044\u304f11\u3010ISR\/Incremental Static Regeneration\u3011<\/div><div class=\"date\">2022.9.19<\/div><div class=\"substr\">\u4eca\u56de\u306f\u3001SSG\u306e\u554f\u984c\u70b9\u3092\u7d39\u4ecb\u3057\u3064\u3064\u305d\u306e\u89e3\u6c7a\u7b56\u3068\u3057\u3066ISR\uff08Incremental Static Regeneration\uff09\u306e\u4ed5\u7d44\u307f\u3068\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002 SSG\/\u9759\u7684\u30b5\u30a4\u30c8\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30fc\u306e\u554f\u984c\u70b9 SSG\uff08Static Site Generation\/\u9759\u7684\u30b5\u30a4\u30c8\u30b8\u30a7\u30cd\u30ec\u30fc\u30b7\u30e7\u30f3\uff09\u3068\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3...<\/div><\/a><\/div>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08pre-rendering\uff09\u76f4\u4e0b\u306edb.json\u3092\u958b\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u8ffd\u52a0\u3057\u305f\u3089\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u3044\u3066\u3001<code>npm run server-json<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>pre-rendering\/db.json<\/strong><\/p>\n<pre class=\"line-numbers\"><code class=\"language-other\">\"events\": [\r\n        {\r\n            \"id\": 1,\r\n            \"title\": \"Event 1\",\r\n            \"description\": \"Description 1\",\r\n            \"category\": \"sports\",\r\n            \"date\": \"April 25\"\r\n        },\r\n        {\r\n            \"id\": 2,\r\n            \"title\": \"Event 2\",\r\n            \"description\": \"Description 2\",\r\n            \"category\": \"technology\",\r\n            \"date\": \"May 25\"\r\n        },\r\n        {\r\n            \"id\": 3,\r\n            \"title\": \"Event 3\",\r\n            \"description\": \"Description 3\",\r\n            \"category\": \"food\",\r\n            \"date\": \"October 25\"\r\n        },\r\n        {\r\n            \"id\": 4,\r\n            \"title\": \"Event 4\",\r\n            \"description\": \"Description 4\",\r\n            \"category\": \"food\",\r\n            \"date\": \"April 25\"\r\n        },\r\n        {\r\n            \"id\": 5,\r\n            \"title\": \"Event 5\",\r\n            \"description\": \"Description 5\",\r\n            \"category\": \"sports\",\r\n            \"date\": \"January 15\"\r\n        },\r\n        {\r\n            \"id\": 6,\r\n            \"title\": \"Event 6\",\r\n            \"description\": \"Description 6\",\r\n            \"category\": \"art\",\r\n            \"date\": \"April 25\"\r\n        },\r\n        {\r\n            \"id\": 7,\r\n            \"title\": \"Event 7\",\r\n            \"description\": \"Description 7\",\r\n            \"category\": \"technology\",\r\n            \"date\": \"June 25\"\r\n        },\r\n        {\r\n            \"id\": 8,\r\n            \"title\": \"Event 8\",\r\n            \"description\": \"Description 8\",\r\n            \"category\": \"sports\",\r\n            \"date\": \"February 28\"\r\n        },\r\n        {\r\n            \"id\": 9,\r\n            \"title\": \"Event 9\",\r\n            \"description\": \"Description 9\",\r\n            \"category\": \"food\",\r\n            \"date\": \"April 25\"\r\n        },\r\n        {\r\n            \"id\": 10,\r\n            \"title\": \"Event 10\",\r\n            \"description\": \"Description 10\",\r\n            \"category\": \"sports\",\r\n            \"date\": \"August 5\"\r\n        }\r\n    ]<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u7d9a\u3044\u3066\u306fpages\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u76f4\u4e0b\u306bevents.js\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3001getServerSideProps\u95a2\u6570\u3067\u8a18\u4e8b\u30c7\u30fc\u30bf\uff08db.json\uff09\u3092\u30d5\u30a7\u30c3\u30c1\u3057\u4e00\u89a7\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>Terminal<\/strong><\/p>\n<pre class=\"line-numbers\"><code class=\"language-other\">touch pre-rendering\/pages\/events.js<\/code><\/pre>\n<p><strong>pre-rendering\/pages\/events.js<\/strong><\/p>\n<pre class=\"line-numbers\"><code class=\"language-js\">function EventList({eventList}){\r\n    return(\r\n        &lt;&gt;\r\n            &lt;h1&gt;List of events&lt;\/h1&gt;\r\n            {\r\n                eventList.map(event =&gt; {\r\n                    return(\r\n                        &lt;div key={event.id}&gt;\r\n                            &lt;h2&gt;\r\n                                {event.id} {event.title} {event.date} | {event.category}\r\n                            &lt;\/h2&gt;\r\n                            &lt;p&gt;{event.description}&lt;\/p&gt;\r\n                            &lt;hr\/&gt;\r\n                        &lt;\/div&gt;\r\n                    )\r\n                })\r\n            }\r\n        &lt;\/&gt;\r\n    )\r\n}\r\n\r\nexport default EventList\r\n\r\nexport async function getServerSideProps() {\r\n    const response = await fetch('http:\/\/localhost:3001\/events')\r\n    const data = await response.json()\r\n\r\n    return{\r\n        props: {\r\n            eventList: data,\r\n        }\r\n    }\r\n}<\/code><\/pre>\n<p><strong>\u7d50\u679c<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-src=\"https:\/\/teno-hira.com\/media\/wp-content\/uploads\/2022\/10\/image2-2.png\" alt=\"\" width=\"617\" height=\"727\" class=\"alignnone size-full wp-image-1904 lazyload\" \/><\/p>\n<p>\u7d9a\u3044\u3066\u306f\u3001\u30da\u30fc\u30b8\u4e0a\u90e8\u306b&lt;button&gt;\u30bf\u30b0\u3092\u7528\u610f\u3057\u3066\u3001\u62bc\u3057\u305f\u30bf\u30b0\u306b\u5fdc\u3058\u3066\u4e00\u89a7\u8868\u793a\u3055\u308c\u308b\u8a18\u4e8b\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>pre-rendering\/pages\/events.js<\/strong><\/p>\n<pre class=\"line-numbers\"><code class=\"language-js\">import {useState} from 'react'\r\n\r\nfunction EventList({eventList}){\r\n    const [events, setEvents] = useState(eventList)\r\n\r\n    const fetchEvents = async (e) =&gt; {\r\n        let eventName = e.currentTarget.dataset['index']\r\n        const response = await fetch(`http:\/\/localhost:3001\/events?category=${eventName}`)\r\n        const data = await response.json()\r\n        setEvents(data)\r\n    }\r\n\r\n    return(\r\n        &lt;&gt;\r\n            &lt;button data-index=\"sports\" onClick={fetchEvents}&gt;Sports Events&lt;\/button&gt;\r\n            &lt;button data-index=\"technology\" onClick={fetchEvents}&gt;Technology Events&lt;\/button&gt;\r\n            &lt;button data-index=\"food\" onClick={fetchEvents}&gt;Food Events&lt;\/button&gt;\r\n            &lt;button data-index=\"art\" onClick={fetchEvents}&gt;Art Events&lt;\/button&gt;\r\n            &lt;h1&gt;List of events&lt;\/h1&gt;\r\n            {\r\n                events.map(event =&gt; {\r\n                    return(\r\n                        &lt;div key={event.id}&gt;\r\n                            &lt;h2&gt;\r\n                                {event.id} {event.title} {event.date} | {event.category}\r\n                            &lt;\/h2&gt;\r\n                            &lt;p&gt;{event.description}&lt;\/p&gt;\r\n                            &lt;hr\/&gt;\r\n                        &lt;\/div&gt;\r\n                    )\r\n                })\r\n            }\r\n        &lt;\/&gt;\r\n    )\r\n}\r\n\r\nexport default EventList\r\n\r\nexport async function getServerSideProps() {\r\n    const response = await fetch('http:\/\/localhost:3001\/events')\r\n    const data = await response.json()\r\n\r\n    return{\r\n        props: {\r\n            eventList: data,\r\n        }\r\n    }\r\n}<\/code><\/pre>\n<p><strong>\u7d50\u679c<\/strong><\/p>\n<p>\u4f8b\u3048\u3070\u300cSports Events\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001sports\u30ab\u30c6\u30b4\u30ea\u306e\u8a18\u4e8b\u3060\u3051\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-src=\"https:\/\/teno-hira.com\/media\/wp-content\/uploads\/2022\/10\/image1-5.png\" alt=\"\" width=\"525\" height=\"655\" class=\"alignnone size-full wp-image-1903 lazyload\" \/><\/p>\n<div class=\"sc_frame_wrap onframe orange\">\n<div class=\"sc_frame_title\">dataset\u3068\u306f\uff1f<\/div>\n<div class=\"sc_frame\">\n<p>\u4eca\u56de\u306f\u3001\u30af\u30ea\u30c3\u30af\u3055\u308c\u305fbutton\u8981\u7d20\u3092\u8b58\u5225\u3059\u308b\u305f\u3081\u306b\u3001HTMLElement.dataset\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4f7f\u3044\u65b9\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3001\u8b58\u5225\u3057\u305f\u3044\u8981\u7d20\u306bdata-xxx=\"\u25cb\u25cb\u25cb\"\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u8981\u7d20\u3092JS\u5074\u3067\u8b58\u5225\u3059\u308b\u969b\u306f\u3001currentTarget.dataset['xxx']\u3068\u8a18\u8ff0\u3057\u307e\u3059\u3002xxx\u306e\u90e8\u5206\u306f\u4efb\u610f\u306b\u6307\u5b9a\u53ef\u80fd\u3067\u3001\u4eca\u56de\u306findex\u3068\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>dataset\u306b\u306f\u3001HTML\u5074\u3067data-xxx\u3092\u6307\u5b9a\u3057\u305f\u3059\u3079\u3066\u306e\u8981\u7d20\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u306e\u3067\u3001dataset['xxx']\u3068\u3044\u3046\u5f62\u3067\u5024\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/HTMLElement\/dataset\">HTMLElement.dataset\uff5cMDN<\/a><\/p>\n<\/div>\n<\/div>\n<h3>CSR\u3067URL\u3082\u5909\u66f4\u3059\u308b<\/h3>\n<p>\u3055\u3066\u3001\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u8981\u7d20\u306b\u5fdc\u3058\u3066\u8a18\u4e8b\u4e00\u89a7\u3092\u66f4\u65b0\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u3057\u305f\u304c\u30011\u3064\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001sports\u30ab\u30c6\u30b4\u30ea\u306e\u8a18\u4e8b\u4e00\u89a7\u30da\u30fc\u30b8\u3092\u53cb\u4eba\u306b\u898b\u305b\u305f\u3044\u5834\u5408\u3001\u591a\u304f\u306f\u30e1\u30c3\u30bb\u30fc\u30b8\u30a2\u30d7\u30ea\u306a\u3069\u3067URL\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u3067\u5bfe\u5fdc\u3059\u308b\u3067\u3057\u3087\u3046\u3002\u3057\u304b\u3057\u5148\u307b\u3069\u306e\u5b9f\u88c5\u3067\u306f\u3001\u3069\u306e\u30ab\u30c6\u30b4\u30ea\u306e\u4e00\u89a7\u30da\u30fc\u30b8\u3082URL\u306f<code>localhost:3000\/events<\/code>\u306e\u307e\u307e\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u7d9a\u3044\u3066\u306fuseRouter Hooks\u3092\u5229\u7528\u3057\u3066\u3001\u8a18\u4e8b\u4e00\u89a7\u3092\u66f4\u65b0\u3059\u308b\u3068\u3068\u3082\u306bURL\u3082\u5909\u66f4\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>pre-rendering\/pages\/events.js<\/strong><\/p>\n<pre class=\"line-numbers\"><code class=\"language-js\">import {useEffect, useState} from 'react'\r\nimport {useRouter} from 'next\/router'\r\n\r\nfunction EventList({eventList}){\r\n    const [events, setEvents] = useState(eventList)\r\n    const router = useRouter()\r\n\r\n    const fetchEvents = async (e) =&gt; {\r\n        const eventName = e.currentTarget.dataset['index']\r\n        const response = await fetch(`http:\/\/localhost:3001\/events?category=${eventName}`)\r\n        const data = await response.json()\r\n        setEvents(data)\r\n        router.push(`\/events?category=${eventName}`, undefined, { shallow: true})\r\n    }\r\n\r\n    return(\r\n        &lt;&gt;\r\n            &lt;button data-index=\"sports\" onClick={fetchEvents}&gt;Sports Events&lt;\/button&gt;\r\n            &lt;button data-index=\"technology\" onClick={fetchEvents}&gt;Technology Events&lt;\/button&gt;\r\n            &lt;button data-index=\"food\" onClick={fetchEvents}&gt;Food Events&lt;\/button&gt;\r\n            &lt;button data-index=\"art\" onClick={fetchEvents}&gt;Art Events&lt;\/button&gt;\r\n            &lt;h1&gt;List of events&lt;\/h1&gt;\r\n            {\r\n                events.map(event =&gt; {\r\n                    return(\r\n                        &lt;div key={event.id}&gt;\r\n                            &lt;h2&gt;\r\n                                {event.id} {event.title} {event.date} | {event.category}\r\n                            &lt;\/h2&gt;\r\n                            &lt;p&gt;{event.description}&lt;\/p&gt;\r\n                            &lt;hr\/&gt;\r\n                        &lt;\/div&gt;\r\n                    )\r\n                })\r\n            }\r\n        &lt;\/&gt;\r\n    )\r\n}\r\n\r\nexport default EventList\r\n\r\nexport async function getServerSideProps(context) {\r\n    const {query} = context\r\n    const {category} = query\r\n    const queryString = category ? `category=${category}` : ''\r\n    const response = await fetch(`http:\/\/localhost:3001\/events?${queryString}`)\r\n    const data = await response.json()\r\n\r\n    return{\r\n        props: {\r\n            eventList: data,\r\n        }\r\n    }\r\n}<\/code><\/pre>\n<p><strong>\u7d50\u679c<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-src=\"https:\/\/teno-hira.com\/media\/wp-content\/uploads\/2022\/10\/image3-1.png\" alt=\"\" width=\"401\" height=\"409\" class=\"alignnone size-full wp-image-1905 lazyload\" \/><\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u4ee5\u4e0a\u3067SSR\u3068CSR\u3092\u7d44\u307f\u3042\u305b\u305f\u30c7\u30fc\u30bf\u30d5\u30a7\u30c3\u30c1\u306b\u3064\u3044\u3066\u306e\u8aac\u660e\u306f\u7d42\u308f\u308a\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6b21\u56de\u306fAPI\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/teno-hira.com\/media\/?p=1901\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"360\" height=\"360\" alt=\"Next.js\u3092\u5c11\u3057\u305a\u3064\u7406\u89e3\u3057\u3066\u3044\u304f15\u3010API GET Request\u3011\" loading=\"lazy\" data-src=\"https:\/\/teno-hira.com\/media\/wp-content\/uploads\/2022\/09\/undraw_next_js_8g5m-360x360.png\" class=\"lazyload\"><\/div><div class=\"title\">Next.js\u3092\u5c11\u3057\u305a\u3064\u7406\u89e3\u3057\u3066\u3044\u304f15\u3010API GET Request\u3011<\/div><div class=\"date\">2022.10.16<\/div><div class=\"substr\">\u4eca\u56de\u306fNext.js\u3092\u4f7f\u3063\u3066API\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3001GET Request\u3092\u6271\u3046\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u74b0\u5883\u69cb\u7bc9 \u307e\u305a\u306f\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u300cnext-api\u300d\u3068\u3044\u3046\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u306b\u3057\u307e\u3057\u305f\u3002 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u306e\u4ed5\u65b9\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3069\u3046\u305e\u3002  \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea...<\/div><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306fSSR\u3068CSR\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30c7\u30fc\u30bf\u3092\u30d5\u30a7\u30c3\u30c1\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u3053\u306e\u8a18\u4e8b\u3067\u3084\u308b\u3053\u3068 \u4eca\u56de\u306f\u30e6\u30fc\u30b6\u30fc\u306e\u64cd\u4f5c\u306b\u5fdc\u3058\u3066\u3001\u8868\u793a\u3059\u308b\u8a18\u4e8b\u4e00\u89a7\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u3092\u66f4\u65b0\u3067\u304d\u308b\u30da\u30fc\u30b8\u3092\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\u3002 \u5177\u4f53\u7684\u306b\u306f\u3001\u30da\u30fc\u30b8\u306e\u4e0a\u90e8\u306b\u7528\u610f\u3057\u305f\u30ab\u30c6\u30b4\u30ea\u2026<\/p>\n","protected":false},"author":15,"featured_media":1675,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90],"tags":[],"class_list":["post-1898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cat-nextjs"],"_links":{"self":[{"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=\/wp\/v2\/posts\/1898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1898"}],"version-history":[{"count":3,"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=\/wp\/v2\/posts\/1898\/revisions"}],"predecessor-version":[{"id":1906,"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=\/wp\/v2\/posts\/1898\/revisions\/1906"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=\/wp\/v2\/media\/1675"}],"wp:attachment":[{"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/teno-hira.com\/media\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}