{"id":2521,"date":"2021-07-10T23:46:52","date_gmt":"2021-07-10T14:46:52","guid":{"rendered":"https:\/\/www.choco.org.uk\/chocodb\/?p=2521"},"modified":"2021-09-11T20:01:27","modified_gmt":"2021-09-11T11:01:27","slug":"centos-stream8%e3%81%a7nodejs%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6web%e3%82%a8%e3%83%87%e3%82%a3%e3%82%bf%e3%82%92%e5%8b%95%e3%81%8b%e3%81%99%e3%80%80%e3%81%9d%e3%81%ae%ef%bc%96","status":"publish","type":"post","link":"https:\/\/www.choco.org.uk\/chocodb\/?p=2521","title":{"rendered":"CentOS Stream8\u3067NodeJs\u3092\u4f7f\u3063\u3066Nadesiko3\u3092\u52d5\u304b\u3059\u3000\u305d\u306e\uff16"},"content":{"rendered":"<a href=\"https:\/\/www.choco.org.uk\/chocodb\/?p=2521&amp;print=1\" title=\"\u3053\u306e\u30da\u30fc\u30b8\u3092\u5370\u5237\u3057\u307e\u3059\u3002\" rel=\"nofollow\"><img decoding=\"async\" class=\"WP-PrintIcon\" src=\"https:\/\/www.choco.org.uk\/chocodb\/wp-content\/plugins\/wp-print\/images\/print.gif\" alt=\"\u3053\u306e\u30da\u30fc\u30b8\u3092\u5370\u5237\u3057\u307e\u3059\u3002\" title=\"\u3053\u306e\u30da\u30fc\u30b8\u3092\u5370\u5237\u3057\u307e\u3059\u3002\" style=\"border: 0px;\" \/><\/a>&nbsp;<a href=\"https:\/\/www.choco.org.uk\/chocodb\/?p=2521&amp;print=1\" title=\"\u3053\u306e\u30da\u30fc\u30b8\u3092\u5370\u5237\u3057\u307e\u3059\u3002\" rel=\"nofollow\">\u3053\u306e\u30da\u30fc\u30b8\u3092\u5370\u5237\u3057\u307e\u3059\u3002<\/a>\n<p>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u3066\u3044\u308b\u5834\u6240\u3092\u7279\u5b9a\u3059\u308b\u70ba\u306b\u300cnako3server.js\u300d\u306e\u4e2d\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><span style=\"color: #0000ff;\">\uff1ecat \/home\/nadesiko\/node_modules\/nadesiko\/src\/nako3server.js<\/span><\/p>\n<p>\/** \u306a\u3067\u3057\u30533\u7c21\u6613EXPRESS\u30b5\u30fc\u30d0\u30fc *\/<\/p>\n<p>const express = require(&#8216;express&#8217;)<br \/>\nconst app = express()<\/p>\n<p>\/\/ set static<br \/>\nconst path = require(&#8216;path&#8217;)<br \/>\nconst rootDir = path.resolve(path.join(__dirname, &#8216;..\/&#8217;))<br \/>\napp.use(express.static(rootDir))<br \/>\nconsole.log(&#8216;documentRoot:&#8217;, rootDir)<\/p>\n<p>\/\/ root =&gt; redirect<br \/>\napp.get(&#8216;\/&#8217;, function (req, res) {<br \/>\n<span style=\"color: #ff00ff;\">res.redirect(302, &#8216;demo\/&#8217;)<\/span><br \/>\n})<\/p>\n<p>\/\/ start server<br \/>\n<span style=\"color: #ff00ff;\">let port = 3000<\/span><br \/>\nlet server = null<br \/>\nconst callbackStart = () =&gt; {<br \/>\nconst opener = require(&#8216;opener&#8217;)<br \/>\nconst port = server.address().port<br \/>\nconsole.log(&#8216;+ \u30b5\u30fc\u30d0\u30fc\u3092\u958b\u59cb\u3057\u307e\u3057\u305f&#8217;)<br \/>\nconsole.log(&#8216;+ [URL] http:\/\/localhost:%s&#8217;, port)<br \/>\n<span style=\"color: #ff00ff;\">opener(&#8216;http:\/\/localhost:&#8217; + port)<\/span><br \/>\n}<\/p>\n<p>server = app<br \/>\n.listen(port, callbackStart)<br \/>\n.on(&#8216;error&#8217;, () =&gt; {<br \/>\nport += 1<br \/>\nserver = app<br \/>\n.listen(port, callbackStart)<br \/>\n.on(&#8216;error&#8217;, () =&gt; {<br \/>\nport += 1<br \/>\nserver = app<br \/>\n.listen(port, callbackStart)<br \/>\n.on(&#8216;error&#8217;, (e) =&gt; {<br \/>\nconsole.log(&#8216;\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002&#8217;)<br \/>\nconsole.log(e.toString())<br \/>\n})<br \/>\n})<br \/>\n})<\/p>\n<p>\u3093\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u524a\u9664\u3059\u308b\u304b\u5909\u66f4\u3059\u308b\u306e\u304c\u6b63\u3057\u305d\u3046\u3002<\/p>\n<p>\u300c\/home\/nadesiko\/node_modules\/nadesiko\/src\/index.js\u300d\u3092\u52d5\u304b\u3059\u3088\u3046\u306b\u3059\u308c\u3070\u3001\u60f3\u5b9a\u901a\u308a\u306b\u52d5\u304f\u306e\u304b\u306a\uff1f<\/p>\n<p>\u305d\u306e\u524d\u306b\u6b63\u3057\u3044\u30d1\u30b9\u3067\u53d6\u308a\u8fbc\u3080\u547d\u4ee4\u3092\u5b9f\u65bd\u3057\u3066\u307f\u308b\u3002<\/p>\n<p><span style=\"color: #0000ff;\">!\u300ehttp:\/\/nako.tokyo:3000\/src\/plugin_browser.js\u300f\u3092\u53d6\u308a\u8fbc\u3080<\/span><br \/>\n<span style=\"color: #0000ff;\">\u4f4d\u7f6e\u60c5\u5831\u53d6\u5f97\u3057\u305f\u6642\u306b\u306f<\/span><br \/>\n<span style=\"color: #0000ff;\">\u5bfe\u8c61\u3092\u8868\u793a\u3002<\/span><br \/>\n<span style=\"color: #0000ff;\">\u3053\u3053\u307e\u3067<\/span><\/p>\n<p><span style=\"color: #ff0000;\">[\u53d6\u308a\u8fbc\u307f\u30a8\u30e9\u30fc]main.nako3(1\u884c\u76ee): \u30d5\u30a1\u30a4\u30eb http:\/\/nako.tokyo:3000\/src\/plugin_browser.js \u306e\u4e2d\u306b\u6587\u5b57\u5217 &#8220;navigator.nako3.addPluginObject&#8221; \u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002\u73fe\u5728\u3001\u30d6\u30e9\u30a6\u30b6\u7248\u306e\u306a\u3067\u3057\u3053\u8a00\u8a9ev3\u306f\u81ea\u52d5\u767b\u9332\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u307f\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p>\u3084\u306f\u308a\u516c\u5f0f\u30da\u30fc\u30b8\u901a\u308a\u3060\u3068\u30b5\u30fc\u30d0\u30fc\u5185\u306e\u300cplugin_browser.js\u300d\u306f\u73fe\u5728\u4f7f\u3048\u306a\u3044\u3088\u3046\u306a\uff1f<\/p>\n<p><span style=\"color: #ff00ff;\">\u301020210728\u3011<\/span><br \/>\n<span style=\"color: #ff00ff;\">SSL\u8a3c\u660e\u66f8\u304c\u7121\u3044\u3068\u4f4d\u7f6e\u60c5\u5831\u547d\u4ee4\u306f\u4f7f\u3048\u306a\u3044\u3068\u8a00\u3046\u3054\u6307\u6458\u3092\u9802\u304d\u307e\u3057\u305f\u306e\u3067\u3001nodejs\u5358\u4f53\u3067\u306e\u306a\u3067\u3057\u3053\uff13\u306b\u3064\u3044\u3066\u306f\u3053\u3053\u307e\u3067\u3068\u3057\u307e\u3059\u3002<\/span><br \/>\n<span style=\"color: #ff00ff;\">\u7406\u7531\u3067\u3059\u304c\u3001nodejs\u5358\u4f53\u3067SSL\u904b\u7528\u3092\u3059\u308b\u4e8b\u306f\u51fa\u6765\u308b\u306e\u3067\u3059\u304c\u3001\u7121\u6599\u306eSSL\u3092\u4f7f\u3046\u5834\u5408\u306b\u66f4\u65b0\u304c\u975e\u5e38\u306b\u9762\u5012\u306a\u306e\u3067\u3059\u3002<\/span><br \/>\n<span style=\"color: #ff00ff;\">\u3088\u3063\u3066\u3001SSL\u5316\u306b\u3064\u3044\u3066\u306fNGINX\u306e\u65b9\u3067\u5b9f\u65bd\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/span><br \/>\n<span style=\"color: #ff00ff;\">\u3053\u3053\u307e\u3067\u304a\u4ed8\u304d\u5408\u3044\u9802\u304d\u307e\u3057\u3066\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u3066\u3044\u308b\u5834\u6240\u3092\u7279\u5b9a\u3059\u308b\u70ba\u306b\u300cnako3server.js\u300d\u306e\u4e2d\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002 \uff1ecat \/home\/nadesiko\/node_modules\/nadesiko\/src\/nako3server.js \/ [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[103,39],"tags":[171,168,167,169],"class_list":["post-2521","post","type-post","status-publish","format-standard","hentry","category-nadesiko3","category-server","tag-cenos-stream","tag-nodejs","tag-sakura-vps","tag-169"],"_links":{"self":[{"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=\/wp\/v2\/posts\/2521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2521"}],"version-history":[{"count":10,"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=\/wp\/v2\/posts\/2521\/revisions"}],"predecessor-version":[{"id":2641,"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=\/wp\/v2\/posts\/2521\/revisions\/2641"}],"wp:attachment":[{"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.choco.org.uk\/chocodb\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}