{"id":5532,"date":"2020-01-09T01:05:47","date_gmt":"2020-01-08T16:05:47","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=5532"},"modified":"2020-01-10T18:42:39","modified_gmt":"2020-01-10T09:42:39","slug":"%e5%ae%89%e5%bf%83%ef%bc%81pm2%e3%81%a7node-js%e3%81%8c%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e8%90%bd%e3%81%a1%e3%81%97%e3%81%aa%e3%81%84%e3%82%88%e3%81%86%e3%81%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=5532","title":{"rendered":"\u5b89\u5fc3\uff01PM2\u3067Node.js\u304c\u30b5\u30fc\u30d0\u30fc\u843d\u3061\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8b\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=5485\">\u5165\u9580\uff01Express\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u57fa\u672c\u306e\u307e\u3068\u3081<\/a>\u300d\u3067\u306f\u521d\u3081\u3066\u672c\u683c\u7684\u306b<code>Node.js<\/code>\u3092\u4f7f\u3063\u305f\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u8a18\u4e8b\u306e\u4e2d\u3067\u3082\u66f8\u3044\u305f\u306e\u3067\u3059\u304c<code>Node.js<\/code>\u306e\u6700\u5927\u306e\u6b20\u70b9\u306f\u958b\u767a\u8005\u306b\u3068\u3063\u3066\u306f\u81f4\u547d\u7684\u3068\u3044\u3063\u3066\u3082\u3044\u3044\u5185\u5bb9\u3067\u3057\u305f\u3002<\/p>\n<p>\u305d\u306e\u5185\u5bb9\u3068\u306f\u30fb\u30fb\u30fb\u305d\u3046\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3068\u3001\u3082\u308c\u306a\u304f\u30b5\u30fc\u30d0\u30fc\u304c\u843d\u3061\u308b<\/strong><\/p>\n<p>\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u4f8b\u3048\u3070\u300c<strong>\u5ba3\u8a00\u3057\u3066\u3044\u306a\u3044\u5909\u6570\u3092\u547c\u3073\u51fa\u3057\u305f<\/strong>\u300d\u3060\u3051\u3067\u3082\u30b5\u30fc\u30d0\u30fc\u304c\u843d\u3061\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304f\u306a\u308b\u3001\u3068\u3044\u3046\u3082\u306e\u3067\u3059\ud83d\ude05<\/p>\n<p>\u3055\u3059\u304c\u306b\u3053\u308c\u3067\u306f\u6016\u304f\u3066\u3068\u3066\u3082\u672c\u756a\u74b0\u5883\u306b\u306f<code>Node.js<\/code>\u3092\u4f7f\u3048\u306a\u3044\u3088\u306d\u30fb\u30fb\u30fb\u3068\u8003\u3048\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u3053\u308d\u304c\u3001\u5c11\u3057\u8abf\u67fb\u3057\u3066\u307f\u308b\u3068\u3001\u3053\u306e<code>Node.js<\/code>\u306e\u6700\u5927\u306e\u6b20\u70b9\u3092\u89e3\u6c7a\u3059\u308b\u65b9\u6cd5\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u306e\u3067\u3001\u4eca\u56de\u306f\u305d\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Express 4.1\u3001Ubuntu 18.04<\/p>\n<h1>Node.js\u306e\u30b5\u30fc\u30d0\u30fc\u843d\u3061\u3092\u9632\u3050\u7b54\u3048\u306f\u300cPM2\u300d<\/h1>\n<p>\u300c<a href=\"https:\/\/pm2.keymetrics.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">PM2<\/a>\u300d\u3068\u3044\u3046\u30d7\u30ed\u30bb\u30b9\u30fb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3092\u4f7f\u3046\u3068\u3001\u305f\u3068\u3048<code>Node.js<\/code>\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u843d\u3061\u3057\u3066\u3082\u3001\u3059\u3050\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3082\u3001\u3053\u308c\u306f<code>Node.js<\/code>\u306b\u9650\u3063\u305f\u8a71\u3067\u306f\u306a\u304f<code>Python<\/code>\u306a\u3093\u304b\u3067\u3082\u4f7f\u3048\u308b\u306e\u3067\u899a\u3048\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u3088\uff01<\/p>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n<code>npm<\/code>\u30b3\u30de\u30f3\u30c9\u4e00\u767a\u3067OK\u3067\u3059\u3002<\/p>\n<pre><strong>sudo npm install pm2 -g<\/strong><\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u8d77\u52d5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>pm2 start app.js<\/strong><\/pre>\n<p>\u203b \u4e0a\u306e\u4f8b\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=5485\">\u524d\u56de\u8a18\u4e8b<\/a>\u3067\u3044\u3046\u3068<code>package.json<\/code>\u306e\u300c<strong>scripts &gt; start<\/strong>\u300d\u3067\u8a2d\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u300c<strong>app.js<\/strong>\u300d\u3092\u5bfe\u8c61\u306b\u3057\u305f\u3082\u306e\uff08\u3064\u307e\u308a\u3001<code>app.listen()<\/code>\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\uff09\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5533\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_2.png\" alt=\"\" width=\"725\" height=\"167\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_2.png 725w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_2-300x69.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<p>\u3053\u308c\u3067<code>Node.js<\/code>\u5185\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3082\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\ud83d\ude0a\u2728<\/p>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u308f\u3056\u3068\u5ba3\u8a00\u3055\u308c\u3066\u3044\u306a\u3044\u5909\u6570<code>unknown<\/code>\u3092\u547c\u3073\u51fa\u3057\u3066\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\uff08\u5168\u3066\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u524d\u56de\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\uff09<\/p>\n<pre>router.get('\/', (req, res) =&gt; {\r\n\r\n  <strong>console.log('\u5b58\u5728\u3057\u306a\u3044\u5909\u6570\u3092\u547c\u3073\u51fa\u3059 =&gt; '+ unknown)<\/strong>\r\n  res.send('\u300cusers\u300d\u306e\u4e00\u89a7\u30da\u30fc\u30b8');\r\n\r\n});<\/pre>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u3001\u30da\u30fc\u30b8\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3057\u3066\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\uff08\u30a8\u30e9\u30fc\u8868\u793a\u306f\u3055\u308c\u307e\u3059\u304c\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u843d\u3061\u305a\u306b\u3059\u3050\u5fa9\u6d3b\u3057\u3066\u3044\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5539\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_6.png\" alt=\"\" width=\"269\" height=\"23\" \/><\/p>\n<p>\u3082\u3061\u308d\u3093\u30a8\u30e9\u30fc\u306e\u306a\u3044\u5225\u30da\u30fc\u30b8\u3082\u304d\u3061\u3093\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3088\uff01<\/p>\n<h1>PM2\u306e\u4f7f\u3044\u65b9\u307e\u3068\u3081<\/h1>\n<p><code>PM2<\/code>\u306b\u306f\u8272\u3005\u3068\u4fbf\u5229\u306a\u6a5f\u80fd\u304c\u3064\u3044\u3066\u3044\u308b\u306e\u3067\u3001\u7279\u306b\u3044\u3044\u306a\u3068\u601d\u3063\u305f\u3082\u306e\u3092\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002\u305c\u3072\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>&#8211;watch\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u3067\u518d\u8aad\u307f\u8fbc\u307f<\/h2>\n<p>\u3053\u308c\u3082\u524d\u56de\u8a18\u4e8b\u3067\u66f8\u304d\u307e\u3057\u305f\u304c\u3001<code>Node.js<\/code>\u304c\u3059\u3067\u306b\u8d77\u52d5\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u5909\u66f4\u3057\u3066\u3082\u3001\u305d\u306e\u5909\u66f4\u5185\u5bb9\u306f\u53cd\u6620\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u5909\u66f4\u304c\u3042\u3063\u305f\u5834\u5408\u306f\u5fc5\u305a\u518d\u8d77\u52d5\u3092\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u8a33\u3067\u3059\u304c\u3001\u7279\u306b\u958b\u767a\u3092\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3044\u3061\u3044\u3061\u9762\u5012\u3060\u3063\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u767b\u5834\u3059\u308b\u306e\u304c<code>--watch<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3060\u3051\u3067\u3001\u3082\u3057\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u5909\u66f4\u304c\u3042\u3063\u305f\u5834\u5408\u306f\u81ea\u52d5\u3067\u518d\u8aad\u307f\u8fbc\u307f\u3092\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<pre>pm2 start app.js <strong>--watch<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u958b\u767a\u304c\u30b9\u30e0\u30fc\u30ba\u306b\u306a\u308b\u306f\u305a\u3067\u3059\ud83d\ude0a<\/p>\n<h2>\u30b9\u30c8\u30c3\u30d7\u3059\u308b<\/h2>\n<p>\u3059\u3067\u306b\u8d77\u52d5\u3057\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d42\u4e86\u3059\u308b\u306b\u306f\u3001<code>stop<\/code>\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>pm2 stop app.js<\/strong><\/pre>\n<h2>\u518d\u8d77\u52d5\u3059\u308b<\/h2>\n<p>\u3059\u3067\u306b<code>PM2<\/code>\u304c\u3042\u308b\u7279\u5b9a\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8d77\u52d5\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u300cpm2 start ****\u300d\u3092\u5b9f\u884c\u3057\u3066\u3082\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<blockquote><p>[PM2][ERROR] Script already launched, add -f option to force re-execution<\/p><\/blockquote>\n<p>\u3082\u3061\u308d\u3093<code>stop<\/code>\u3057\u3066\u304b\u3089\u3082\u3046\u4e00\u5ea6<code>start<\/code>\u3068\u3057\u3066\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>restart<\/code>\u3092\u4f7f\u3046\u3068\u3001\u4e00\u6c17\u306b\u3053\u306e\uff12\u3064\u306e\u4f5c\u696d\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>pm2 restart app.js<\/strong><\/pre>\n<h2>\u8d77\u52d5\u4e2d\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3059\u308b<\/h2>\n<p>\u73fe\u5728\u3059\u3067\u306b\u8d77\u52d5\u3057\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u306b\u306f<code>list<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>pm2 list<\/strong><\/pre>\n<h2>\u8d77\u52d5\u4e2d\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306a\u60c5\u5831\u3092\u8868\u793a\u3059\u308b<\/h2>\n<p>\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u8d77\u52d5\u4e2d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u306b\u306f<code>monit<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>pm2 monit<\/strong><\/pre>\n<p>\u5b9f\u969b\u306e\u8868\u793a\u306f\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5536\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_3.png\" alt=\"\" width=\"724\" height=\"424\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_3.png 724w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_3-300x176.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/p>\n<p>\u203b \u7d42\u4e86\u306f<code>Ctrl + C<\/code>\u3067\u3059\u3002<\/p>\n<h2>\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b<\/h2>\n<p>\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u306b\u306f<code>logs<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>pm2 logs<\/strong><\/pre>\n<p>\u307e\u305f\u3001\u30ed\u30b0\u3092\u5168\u6d88\u53bb\u3059\u308b\u306b\u306f\u300c<strong>pm2 flush<\/strong>\u300d\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u3061\u306a\u307f\u306b\uff1aExpress\u3067\u30a8\u30e9\u30fc\u30da\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u306b\u306f<\/h1>\n<p>\u3061\u306a\u307f\u306b\u3001\u3082\u3057\u672c\u756a\u74b0\u5883\u3067\u30a8\u30e9\u30fc\u5185\u5bb9\u304c\u30d6\u30e9\u30a6\u30b6\u306b\u8868\u793a\u3055\u308c\u308b\u3068\u30cf\u30c3\u30ab\u30fc\u306b\u3068\u3063\u3066\u653b\u6483\u3092\u3059\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u8db3\u304c\u304b\u308a\u3092\u4e0e\u3048\u3066\u3057\u307e\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3089\u5c02\u7528\u306e\u30da\u30fc\u30b8\u3092\u8868\u793a\u3055\u305b\u308b\u3088\u3046\u306b\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u203b \u305f\u3060\u3057\u3001\u5fc5\u305a\u30a8\u30e9\u30fc\u51e6\u7406\u306f<strong>\u30eb\u30fc\u30c8\u306e\u5f8c<\/strong>\u306b\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>const express = require('express');\r\nconst app = express();\r\n\r\n\/\/ \u7701\u7565\r\n\r\n\/\/ \u30eb\u30fc\u30c8\r\napp.use('\/users', require('.\/routes\/users'));\r\n\r\n\/\/ \u30a8\u30e9\u30fc\r\n<strong>app.use((err, req, res, next) =&gt; {<\/strong>\r\n<strong>    console.error(err.stack)<\/strong>\r\n<strong>    res.status(500).send('\u4e88\u671f\u305b\u306c\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f...\ud83d\ude2b')<\/strong>\r\n<strong>});<\/strong>\r\n\r\nconst PORT = process.env.PORT || 5000;\r\napp.listen(PORT, () =&gt; {\r\n    console.log(`${PORT}\u756a\u306e\u30dd\u30fc\u30c8\u3067\u5f85\u6a5f\u4e2d\u3067\u3059...`);\r\n});<\/pre>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u3066\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5537\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_4.png\" alt=\"\" width=\"482\" height=\"80\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_4.png 482w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_4-300x50.png 300w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><\/p>\n<p>\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u3082\u304d\u3061\u3093\u3068<code>500<\/code>\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5538\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_5.png\" alt=\"\" width=\"337\" height=\"140\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_5.png 337w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/01\/pm2_5-300x125.png 300w\" sizes=\"auto, (max-width: 337px) 100vw, 337px\" \/><\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Node.js<\/code>\u306e\u6700\u5927\u306e\u554f\u984c\u70b9\u300c<strong>\u30a8\u30e9\u30fc\u767a\u751f\u6642\u306b\u30b5\u30fc\u30d0\u30fc\u843d\u3061\u3059\u308b<\/strong>\u300d\u90e8\u5206\u3092<code>PM2<\/code>\u3067\u89e3\u6c7a\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><code>PM2<\/code>\u306e\u5b58\u5728\u3092\u77e5\u308b\u307e\u3067\u306f\u3001<code>Node.js<\/code>\u306f\u672c\u756a\u74b0\u5883\u3068\u3057\u3066\u306f\u3069\u3046\u3060\u308d\u3046\u304b\u30fb\u30fb\u30fb\u3068\u8003\u3048\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u554f\u984c\u306f\u30af\u30ea\u30a2\u3067\u304d\u305d\u3046\u3067\u3059\u3002\uff08\u3057\u304b\u3082<a href=\"https:\/\/expressjs.com\/en\/advanced\/pm.html\" target=\"_blank\" rel=\"noopener noreferrer\">Express\u306b\u3088\u308b\u3068<\/a>\u3001\u4ed6\u306b\u3082\u540c\u3058\u3088\u3046\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3044\u304f\u3064\u304b\u3042\u308b\u3088\u3046\u3067\u3059\u306d\uff09<\/p>\n<p>\u3053\u308c\u307e\u3067<code>PHP<\/code>\u3001<code>JavaScript<\/code>\uff08\u30d6\u30e9\u30a6\u30b6\uff09\u3001<code>Python<\/code>\u304c\u30e1\u30a4\u30f3\u3067\u958b\u767a\u3092\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u3084\u306f\u308a\u307e\u3060\u307e\u3060\u77e5\u3089\u306a\u3044\u3053\u3068\u304c\u305f\u304f\u3055\u3093\u3042\u308b\u3082\u3093\u3060\u3068\u5b9f\u611f\u3057\u307e\u3057\u305f\u3002\uff08\u30c9\u30e9\u30b4\u30f3\u30dc\u30fc\u30eb\u3067\u8a00\u3046\u3068\u3053\u308d\u306e\u300c\u30aa\u30e9\u3001\u30ef\u30af\u30ef\u30af\u3059\u3063\u305e\uff01\u300d\u72b6\u614b\u3067\u3059\ud83d\ude09\u2728\uff09<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082<code>Express<\/code>\uff08<code>Node.js<\/code>\uff09\u3067\u306e\u958b\u767a\u3082\u691c\u8a0e\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2594 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/23.png\" alt=\"\" width=\"182\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/23.png 182w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/23-171x300.png 171w\" sizes=\"auto, (max-width: 182px) 100vw, 182px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8b\u300c\u5165\u9580\uff01Express\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u57fa\u672c\u306e\u307e\u3068\u3081\u300d\u3067\u306f\u521d\u3081\u3066\u672c\u683c\u7684\u306bNode.js\u3092\u4f7f\u3063\u305f\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002 \u305d\u3057\u3066\u3001\u3053\u306e\u8a18\u4e8b\u306e\u4e2d\u3067\u3082\u66f8 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=5532\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u5b89\u5fc3\uff01PM2\u3067Node.js\u304c\u30b5\u30fc\u30d0\u30fc\u843d\u3061\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":5545,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[201,203,73],"tags":[],"class_list":["post-5532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-express","category-node-js","category-73"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5532"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5532\/revisions"}],"predecessor-version":[{"id":5544,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5532\/revisions\/5544"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/5545"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}