{"id":67,"date":"2015-05-17T01:41:00","date_gmt":"2015-05-16T16:41:00","guid":{"rendered":"https:\/\/jikoman.sin-cos.com\/blog\/?p=67"},"modified":"2015-05-17T01:41:00","modified_gmt":"2015-05-16T16:41:00","slug":"google-developers6","status":"publish","type":"post","link":"https:\/\/jikoman.sin-cos.com\/blog\/2015\/05\/google-developers6\/","title":{"rendered":"Google Developers\u306b\u3066(6)"},"content":{"rendered":"<p>&gt; index.html\u306ecss\u304c\u8aad\u307f\u8fbc\u307e\u308c\u306a\u3044\uff1f<br \/>\n&gt; .tmp\u30d5\u30a9\u30eb\u30c0\u304c\u5fc5\u8981\u306a\u306e\uff1f<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u76f4\u63a5\u30b5\u30fc\u30d0\u304b\u3089\u51fa\u529b\u3055\u308c\u308b\u30da\u30fc\u30b8\u3068\u3001\u30d7\u30ed\u30ad\u30b7\u7d4c\u7531\u306e\u30da\u30fc\u30b8\u3092\u5206\u3051\u308b\u5fc5\u8981\u304c\u3042\u308b\u307f\u305f\u3044\u306a\u306e\u3067\u3001\u8abf\u67fb\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3067\u3001\u6b63\u89e3\u304b\u3069\u3046\u304b\u306f\u308f\u304b\u3089\u306a\u3044\u3067\u3059\u304c\u3001\u89e3\u6c7a\u65b9\u6cd5\u3092\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001http-proxy\u306a\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<p>$ npm install &#8211;save-dev http-proxy<br \/>\ngulpfile.fs\u30d5\u30a1\u30a4\u30eb\u306b\u6b21\u306e\u5909\u66f4\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u30b3\u30e1\u30f3\u30c8\u4ee5\u4e0b\u306e\u30d6\u30ed\u30c3\u30af\u306b\u3001<\/p>\n<p>\/\/ Include Gulp &amp; tools we&#8217;ll use<br \/>\n\u6b21\u306e\u884c\u3092\u8ffd\u52a0<\/p>\n<p>var httpProxy = require(&#8216;http-proxy&#8217;);<\/p>\n<div>\n<div>\n\u6b21\u306e\u30d6\u30ed\u30c3\u30af\u3092\u6b21\u306e\u3088\u3046\u306b\u5909\u66f4<\/div>\n<div>\n<p>\/\/ Watch files for changes &amp; reload<br \/>\ngulp.task(&#8216;serve&#8217;, [&#8216;styles&#8217;], function () {<br \/>\n&nbsp; var proxy = httpProxy.createProxyServer({});<br \/>\n&nbsp; browserSync({<br \/>\n&nbsp; &nbsp; notify: false,<br \/>\n&nbsp; &nbsp; \/\/ Customize the BrowserSync console logging prefix<br \/>\n&nbsp; &nbsp; logPrefix: &#8216;WSK&#8217;,<br \/>\n&nbsp; &nbsp; \/\/ Run as an https by uncommenting &#8216;https: true&#8217;<br \/>\n&nbsp; &nbsp; \/\/ Note: this uses an unsigned certificate which on first access<br \/>\n&nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; will present a certificate warning in the browser.<br \/>\n&nbsp; &nbsp; \/\/ https: true,<br \/>\n&nbsp; &nbsp; \/\/server :[&#8216;.tmp&#8217;, &#8216;app&#8217;],<br \/>\n&nbsp; &nbsp; \/\/ PHP\u306e\u30da\u30fc\u30b8\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u3001Proxy\u306e\u8a2d\u5b9a\u3092\u884c\u3046<br \/>\n&nbsp; &nbsp; \/\/proxy: &#8220;localhost:8888&#8221;,<br \/>\n&nbsp; &nbsp; server: {<br \/>&nbsp; &nbsp;  baseDir :[&#8216;.tmp&#8217;, &#8216;app&#8217;],<br \/>&nbsp; &nbsp; &nbsp; \/\/ THIS IS THE ADDED MIDDLEWARE<br \/>&nbsp; &nbsp;  middleware: function (req, res, next) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp;  var url = req.url;<br \/>&nbsp; &nbsp; &nbsp; &nbsp;  if (!url.match(\/^\/(styles|fonts|bower_components)\/\/)) {<br \/>&nbsp; &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp;proxy.web(req, res, { target: &#8216;http:\/\/localhost:8888&#8217; });<br \/>&nbsp; &nbsp; &nbsp; &nbsp;  } else {<br \/>&nbsp; &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp;next();<br \/>&nbsp; &nbsp; &nbsp; &nbsp;  }<br \/>&nbsp; &nbsp;  }<br \/>&nbsp; &nbsp; }<br \/>\n&nbsp; &nbsp; \/\/ external \u6307\u5b9a\u3059\u308b\u3068\u3001\u5b9f\u884c\u6642\u306e\u30a2\u30af\u30bb\u30b9URL\u304cIP\u30a2\u30c9\u30ec\u30b9\u6307\u5b9a\u5074\u3067\u958b\u304f\u3053\u3068\u304c\u3067\u304d\u308b<br \/>\n&nbsp; &nbsp; \/\/external<br \/>\n&nbsp; });\n<\/div>\n<\/div>\n<div>\n\u3053\u308c\u3067\u3001styles,fonts,bower_components\u306e3\u3064\u306e\u30d5\u30a9\u30eb\u30c0\u4ee5\u5916\u306f\u30d7\u30ed\u30ad\u30b7\u7d4c\u7531\u3067\u8868\u793a\u3055\u308c\u308b\u3068\u3002<\/div>\n<div>\n<\/div>\n<p>\u3053\u308c\u3067\u3001Web starter kit\u3092PHP\u306b\u5bfe\u5fdc\u51fa\u6765\u305f\u3068\u601d\u3063\u3066\u3044\u3044\u306e\u304b\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&gt; index.html\u306ecss\u304c\u8aad\u307f\u8fbc\u307e\u308c\u306a\u3044\uff1f &gt; .tmp\u30d5\u30a9\u30eb\u30c0\u304c\u5fc5\u8981\u306a\u306e\uff1f \u3068\u3044\u3046\u3053\u3068\u3067\u3001\u76f4\u63a5\u30b5\u30fc\u30d0\u304b\u3089\u51fa\u529b\u3055\u308c\u308b\u30da\u30fc\u30b8\u3068\u3001\u30d7\u30ed\u30ad\u30b7\u7d4c\u7531\u306e\u30da\u30fc\u30b8\u3092\u5206\u3051\u308b\u5fc5\u8981\u304c\u3042\u308b\u307f\u305f\u3044\u306a\u306e\u3067\u3001\u8abf\u67fb\u3057\u307e\u3057\u305f\u3002 \u3067\u3001\u6b63 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[130],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-130"],"_links":{"self":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":0,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}