{"id":6759,"date":"2022-11-04T07:39:27","date_gmt":"2022-11-03T22:39:27","guid":{"rendered":"https:\/\/suzutukiblog.com\/?p=6759"},"modified":"2022-12-04T10:26:29","modified_gmt":"2022-12-04T01:26:29","slug":"vuerails-4","status":"publish","type":"post","link":"https:\/\/suzutukiblog.com\/index.php\/2022\/11\/04\/vuerails-4\/","title":{"rendered":"Vue\u3068Rails\u3067\u4f5c\u6210\u3057\u305f\u30a2\u30d7\u30ea\u3067\u5f97\u305f\u77e5\u898b\u3068\u5099\u5fd8\u93324(Axios\u3068CORS)"},"content":{"rendered":"<p><a href=\"https:\/\/suzutukiblog.com\/index.php\/2022\/12\/04\/vuerails-3\/\">3\u304b\u3089\u7d9a\u3044\u3066\u3044\u307e\u3059<\/a><\/p>\n<h2>\u76ee\u6a19\uff1a\u3059\u3050\u306b\u601d\u3044\u51fa\u305b\u308b\u3088\u3046\u306b\u3056\u3063\u304f\u308a\u89e3\u8aac\u3059\u308b\u3002<\/h2>\n<h2>\u6d41\u308c<\/h2>\n<ol>\n<li>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u304b\u3089\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u7528\u306bAxios\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u5165\u308c\u3089\u308c\u308b\u7528\u306bCORS\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/li>\n<li>TODO\u306e\u767b\u9332\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308a\u3001\u4fdd\u5b58\u3055\u308c\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<h1 data-v-12015439=\"\">\u524d\u63d0\u77e5\u8b58<\/h1>\n<h3>Axios\u3068\u306f\uff1f<\/h3>\n<p>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u304b\u3089\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308b\u3068\u304d\u306b\u4f7f\u3063\u3066\u3044\u304f\u30e9\u30a4\u30d6\u30e9\u30ea\u3067<br \/>\n\u30d6\u30e9\u30a6\u30b6\u3084Node.js\u4e0a\u3067\u52d5\u304f<strong>Promise<\/strong>\u30d9\u30fc\u30b9\u306eHTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<h3>Promise\u3068\u306f<\/h3>\n<p>JavaScript\u306e<strong>\u975e\u540c\u671f\u51e6\u7406<\/strong>\u306e\u5b8c\u4e86\u3082\u3057\u304f\u306f\u5931\u6557\u3092\u8868\u3059\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3001<br \/>\n\u975e\u540c\u671f\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u305f\u3068\u304d\u306b\u7d50\u679c\u3092\u8fd4\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<h3>HTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u306f<\/h3>\n<p>GET\u30fbPOST\u30fbPATCH\u306a\u3069\u306eHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3057\u3066\u3001<br \/>\n\u305d\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u53d7\u4fe1\u3067\u304d\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<p><strong>Axios\u3092\u5229\u7528\u3059\u308b<\/strong>\u3068<strong>JavaScript<\/strong>\u3067<strong>\u975e\u540c\u671f\u51e6\u7406<\/strong>\u3092\u884c\u3046\u969b\u306b<strong>HTTP\u30ea\u30af\u30a8\u30b9\u30c8<\/strong>\u3092<strong>\u9001\u3063\u3066\u3001\u30ec\u30b9\u30dd\u30f3\u30b9<\/strong>\u3092<strong>\u8fd4\u3057\u3066\u3082\u3089\u3044\u3001\u4f55\u3089\u304b\u306e\u51e6\u7406<\/strong>\u3092<strong>\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b<\/strong>\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1 data-v-12015439=\"\">4\u7ae0\uff1aAPI\u306e\u9023\u643a\u3092\u3059\u308b<\/h1>\n<h2>1:\u30d5\u30ed\u30f3\u30c8\u304b\u3089\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u7528\u306baxios\u3092\u8a2d\u5b9a\u3059\u308b<\/h2>\n<h3>Axios\u306e\u8a2d\u5b9a\uff1abaseURL\u306e\u8a2d\u5b9a<\/h3>\n<p><strong>baseURL<\/strong>\u306f\u74b0\u5883\u5909\u6570\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<br \/>\n<strong>Nuxt.js<\/strong>\u3067\u74b0\u5883\u5909\u6570\u3092\u6271\u3046\u969b\u306f<strong>@nuxtjs\/dotenv<\/strong>\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n<p>front\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre>npm install --save-dev @nuxtjs\/dotenv<\/pre>\n<h2>front\/nuxt.config.js\u306b<strong>buildModules<\/strong>\u3068\u3044\u3046\u90e8\u5206\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u3053\u306b\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/h2>\n<pre>'@nuxtjs\/dotenv', \/\/ \u8ffd\u8a18<\/pre>\n<p>.env\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u968e\u5c64\u69cb\u9020\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre>nuxt-rails-todo\r\n\u251c\u2500\u2500 api\r\n\u2514\u2500\u2500 front\r\n  \u2514\u2500\u2500 .env<\/pre>\n<p>\u305d\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre>API_ENDPOINT=\"http:\/\/localhost:3000\"<\/pre>\n<p><strong>Rails<\/strong>\u306f\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3059\u308b\u3068\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067<strong>\u30dd\u30fc\u30c83000<\/strong>\u304c\u4f7f\u7528\u3055\u308c\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<p><strong>Nuxt<\/strong>\u3067\u3082<strong>\u30dd\u30fc\u30c83000<\/strong>\u3092\u4f7f\u3063\u3066\u3044\u308b\u305f\u3081\u885d\u7a81\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p><strong>front\/nuxt.config.js<\/strong>\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3067<strong>Nuxt<\/strong>\u5074\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>front\/nuxt.config.js<\/strong><\/p>\n<pre>import colors from 'vuetify\/es5\/util\/colors'\r\n\r\nexport default {\r\n server: {\r\n  <strong>port: 8080<\/strong> \r\n},\r\n\r\n<\/pre>\n<p>\u3053\u308c\u3067\u3001npm run dev\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<strong>8080\u756a\u30dd\u30fc\u30c8<\/strong>\u304c\u4f7f\u7528\u3055\u308c\u3001<br \/>\nRails\u3068\u540c\u3058\u30dd\u30fc\u30c8\u3067\u3076\u3064\u304b\u308b\u3053\u3068\u3082\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>npm run dev\u3092\u5b9f\u884c\u3057\u3066\u3001<a href=\"http:\/\/localhost:8080\/\">http:\/\/localhost:8080\/<\/a>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001<br \/>\nToDo\u306e\u4e00\u89a7\u753b\u9762\u304c\u51fa\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<h2>2\uff1a\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u5165\u308c\u3089\u308c\u308b\u3088\u3046\u306bCORS\u306e\u8a2d\u5b9a\u3092\u3059\u308b<\/h2>\n<h3>CORS\u3068\u306f\uff1f<\/h3>\n<p><strong>Cross-origin Resource Sharing<\/strong>\u306e\u7565\u79f0(\u30aa\u30ea\u30b8\u30f3\u9593\u306e\u30ea\u30bd\u30fc\u30b9\u5171\u6709)<\/p>\n<p>\u5f79\u5272\u306f\u540c\u4e00\u30aa\u30ea\u30b8\u30f3\u30dd\u30ea\u30b7\u30fc(Same-Origin Policy)\u3068\u3044\u3046\u30eb\u30fc\u30eb\u306b\u3088\u3063\u3066<br \/>\n\u8a2d\u3051\u3089\u308c\u305f\u5236\u9650\u3092\u7de9\u3081\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<h3>\u540c\u4e00\u5236\u9650\u30dd\u30ea\u30b7\u30fc\u3068\u306f\uff1f<\/h3>\n<p>\u540c\u4e00\u30aa\u30ea\u30b8\u30f3\u30dd\u30ea\u30b7\u30fc\u3068\u306f\u3001\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u306b\u8a2d\u3051\u3089\u308c\u305f\u3001<br \/>\n\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u653b\u6483\u306a\u3069\u306e\u9632\u6b62\u306e\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3067\u3059\u3002<br \/>\n\u7570\u306a\u308b\u30aa\u30ea\u30b8\u30f3\u9593\u306e\u30ea\u30bd\u30fc\u30b9\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306b\u5236\u7d04\u3092\u304b\u3051\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<p><strong>\u30aa\u30ea\u30b8\u30f3\u3068\u306f\u3001URI\u306e\u30b9\u30ad\u30fc\u30e0\u3001\u30db\u30b9\u30c8\u3001\u30dd\u30fc\u30c8\u756a\u53f7\u306e\u7d44\u307f\u5408\u308f\u305b<\/strong>\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<strong>http:\/\/localhost:3000<\/strong>\u3068\u3044\u3046<strong>URI<\/strong>\u304c\u3042\u3063\u305f\u3068\u304d\u306b\u3001\u30aa\u30ea\u30b8\u30f3\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5206\u89e3\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>http: \u30b9\u30ad\u30fc\u30e0\r\nlocalhost: \u30db\u30b9\u30c8\r\n3000: \u30dd\u30fc\u30c8\u756a\u53f7<\/pre>\n<p>\u7570\u306a\u308b\u30aa\u30ea\u30b8\u30f3\u9593\u3067\u30ea\u30bd\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u3057\u305f\u6642\u306b\u3001\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u304c\u5236\u9650\u3092\u304b\u3051\u3066\u304f\u308c\u308b\u4ed5\u7d44\u307f\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3>CORS\u306f\u4f55\u306e\u305f\u3081\u306b\u8a2d\u5b9a\u3059\u308b\uff1f<\/h3>\n<p><strong>\u540c\u4e00\u30aa\u30ea\u30b8\u30f3\u30dd\u30ea\u30b7\u30fc<\/strong>\u3068\u3044\u3046\u30eb\u30fc\u30eb\u306b\u3088\u3063\u3066\u8a2d\u3051\u3089\u308c\u305f\u5236\u9650\u3092\u7de9\u3081\u308b\u305f\u3081\u3067<br \/>\n\u4f5c\u6210\u3057\u3066\u3044\u308b\u30a2\u30d7\u30ea\u306f\u3001<strong>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9<\/strong>\u3068<strong>\u30d0\u30c3\u30af\u30a8\u30f3\u30c9<\/strong>\u304c\u5206\u304b\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n<strong>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9<\/strong>\u304b\u3089<strong>\u30d0\u30c3\u30af\u30a8\u30f3\u30c9<\/strong>\u3078\u4f55\u304b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u884c\u3046\u3068\u3001\u3053\u306e<strong>\u540c\u4e00\u5236\u9650\u30dd\u30ea\u30b7\u30fc\u306b\u5f15\u3063\u304b\u304b\u3063\u3066<\/strong>\u3057\u307e\u3044\u3001\u30a2\u30d7\u30ea\u304c\u610f\u56f3\u3057\u305f\u3088\u3046\u306b<strong>\u52d5\u4f5c\u3057\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/strong><br \/>\n\u305d\u306e\u305f\u3081\u3001<strong>CORS<\/strong>\u3068\u3044\u3046\u90e8\u5206\u7684\u306b\u540c\u4e00\u30aa\u30ea\u30b8\u30f3\u30dd\u30ea\u30b7\u30fc\u3092\u89e3\u9664\u3059\u308b\u8a2d\u5b9a\u3092\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>3\uff1aRailsAPI\u3067\u306eCORS\u8a2d\u5b9a\u65b9\u6cd5<\/h2>\n<h3>Gem\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>Rails\u3067CORS\u3092\u8a31\u53ef\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306aGem\u3092\u5165\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u5916\u3057\u307e\u3059\u3002<\/p>\n<h2>api\/Gemfile<\/h2>\n<pre># Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible\r\ngem 'rack-cors'<\/pre>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/p>\n<pre>cd ..\/api\r\nbundle install<\/pre>\n<h3>4\uff1aCORS\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6<\/h3>\n<p><strong>api\/config\/initializers\/cors.rb<\/strong>\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre>#\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u5916\u3057\u30668080\u306b\u3059\u308b\r\nRails.application.config.middleware.insert_before 0, Rack::Cors do\r\n allow do\r\n  origins 'localhost:8080' \r\n\r\n  resource '*',\r\n headers: :any,\r\n methods: [:get, :post, :put, :patch, :delete, :options, :head]\r\nend\r\nend<\/pre>\n<h2>5\uff1aNuxt\u5074\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u90e8\u5206\u3092\u4fee\u6b63\u3059\u308b<\/h2>\n<p><strong>front\/pages\/index.vue<\/strong>\u3092\u958b\u3044\u3066\u3001<strong>&lt;script&gt;<\/strong>\u306e\u4e2d\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<code class=\"language-vue:front\/pages\/index.vue\"><\/code><\/p>\n<div class=\"code-label\"><strong>front\/pages\/index.vue\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u90e8\u5206\u304b\u3089\u8ffd\u8a18<\/strong><\/div>\n<div class=\"code-body\">\n<div class=\"code-body-inline\"><\/div>\n<\/div>\n<pre class=\"hljs\"><code><span class=\"xml\"><strong><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span>&gt;\r\n<\/span><\/strong><\/span><strong><span class=\"javascript\"><span class=\"hljs-keyword\">  import<\/span> AddTodo <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@\/components\/AddTodo\"<\/span>;\r\n  <span class=\"hljs-keyword\">import<\/span> TodoList <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@\/components\/TodoList\"<\/span>;\r\n  <span class=\"hljs-keyword\">import<\/span> axios <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@\/plugins\/axios\"<\/span>;  <span class=\"hljs-comment\">\/\/ \u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u306bHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u3059\u308b\u305f\u3081\u306b\u3001axios\u3092\u8ffd\u52a0<\/span>\r\n\r\n  <span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> {\r\n    <span class=\"hljs-attr\">components<\/span>: {\r\n      AddTodo,\r\n      TodoList,\r\n    },\r\n    data() {\r\n      <span class=\"hljs-keyword\">return<\/span> {\r\n        <span class=\"hljs-attr\">todos<\/span>: [],\r\n      };\r\n    },\r\n    <span class=\"hljs-attr\">methods<\/span>: {\r\n      <span class=\"hljs-keyword\">async<\/span> addTodo(title) { <span class=\"hljs-comment\">\/\/ \u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u51e6\u7406\u3092\u52d5\u304b\u3057\u3064\u3064\u3001\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u3082ToDo\u306e\u767b\u9332\u3092\u884c\u3044\u305f\u3044\u305f\u3081\u3001\u975e\u540c\u671f\u3067\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308b<\/span>\r\n        <span class=\"hljs-keyword\">await<\/span> axios.post(<span class=\"hljs-string\">\"\/v1\/todos\"<\/span>, { title }); <span class=\"hljs-comment\">\/\/ await\u3067\u4e0b\u306e\u51e6\u7406\u304c\u5148\u306b\u5b9f\u884c\u3055\u308c\u308b\u306e\u3092\u9632\u3050\u3002<\/span>\r\n        <span class=\"hljs-keyword\">this<\/span>.todos.push({\r\n          title\r\n        });\r\n      },\r\n    },\r\n  };\r\n<\/span><span class=\"xml\"><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span><\/span><\/strong><\/code><code class=\"language-vue:front\/pages\/index.vue\"><\/code><\/pre>\n<p>\u2191\u306e<strong>async<\/strong>\u3084<strong>await<\/strong>\u306f\u4f5c\u6210\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u3089\u3001\u5148\u306b\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u5074\u3067ToDo\u3092\u767b\u9332\u3059\u308b\u51e6\u7406\u3092\u78ba\u5b9f\u306b\u884c\u3044\u305f\u3044\u305f\u3081\u3067\u3059\u3002<\/p>\n<pre>axios.post(\"\/v1\/todos\", { title });<\/pre>\n<p>\u2191\u3067\u306fTODO\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u5024\u3068\u3057\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\uff08API\uff09\u306e<code>v1\/todos<\/code>\u3068\u3044\u3046URL\u306bPOST\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/suzutukiblog.com\/index.php\/2022\/12\/04\/vuerails-5\/\">\u305d\u306e5\u306b\u7d9a\u304f<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>3\u304b\u3089\u7d9a\u3044\u3066\u3044\u307e\u3059 \u76ee\u6a19\uff1a\u3059\u3050\u306b\u601d\u3044\u51fa\u305b\u308b\u3088\u3046\u306b\u3056\u3063\u304f\u308a\u89e3\u8aac\u3059\u308b\u3002 \u6d41\u308c \u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u304b\u3089\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u7528\u306bAxios\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u5165\u308c\u3089\u308c\u308b\u7528\u306bCORS\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[27],"tags":[],"class_list":["post-6759","post","type-post","status-publish","format-standard","hentry","category-programming-note"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/6759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=6759"}],"version-history":[{"count":7,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/6759\/revisions"}],"predecessor-version":[{"id":6771,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/6759\/revisions\/6771"}],"wp:attachment":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=6759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=6759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=6759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}