{"id":5923,"date":"2020-02-20T18:37:29","date_gmt":"2020-02-20T09:37:29","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=5923"},"modified":"2020-03-06T17:08:30","modified_gmt":"2020-03-06T08:08:30","slug":"express%e3%81%a7%e3%83%91%e3%82%b9%e3%83%af%e3%83%bc%e3%83%89%e5%86%8d%e7%99%ba%e8%a1%8c%e6%a9%9f%e8%83%bd%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b%ef%bc%88%e3%83%80%e3%82%a6%e3%83%b3%e3%83%ad%e3%83%bc","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=5923","title":{"rendered":"Express\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u6a5f\u80fd\u3092\u3064\u304f\u308b\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\uff09"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8b\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=5893\">Express\u3067\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u6a5f\u80fd<\/a>\u300d\u3067\u3082\u5c11\u3057\u89e6\u308c\u307e\u3057\u305f\u304c\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u6a5f\u80fd\u3092\u3064\u304f\u308b\u969b\u306b\u300c<strong>\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u6a5f\u80fd<\/strong>\u300d\u3001\u3044\u308f\u3086\u308b\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u30fb\u30ea\u30de\u30a4\u30f3\u30c0\u30fc\u300d\u3082\u540c\u6642\u306b\u958b\u767a\u3057\u3088\u3046\u3068\u8003\u3048\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u305f\u3060\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u6a5f\u80fd\u304c\u4e88\u60f3\u3092\u4e0a\u56de\u308b\u30b3\u30fc\u30c9\u91cf\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u3001\u3042\u3048\u306a\u304f\u5225\u8a18\u4e8b\u306b\u3059\u308b\u3079\u304d\u3068\u5224\u65ad\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u4eca\u56de\u306f\u305d\u308c\u3092\u53d7\u3051\u3066\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u518d\u767a\u884c\u6a5f\u80fd\u3092Express\u3067\u3064\u304f\u308b<\/strong><\/p>\n<p>\u3092\u30c6\u30fc\u30de\u306b\u3057\u3066\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u307f\u306a\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-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Node 8\u3001Express 4.1<\/p>\n<h1>\u624b\u9806<\/h1>\n<p>\u4eca\u56de\u958b\u767a\u3059\u308b\u300c<strong>\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u6a5f\u80fd<\/strong>\u300d\u306f\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u5b9f\u884c\u3059\u308b\u6a5f\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30e6\u30fc\u30b6\u30fc\u304c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u9001\u4fe1<\/li>\n<li>\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u30e1\u30fc\u30eb\u3092\u9001\u4fe1<\/li>\n<li>\u30e1\u30fc\u30eb\u306b\u66f8\u304b\u308c\u3066\u3044\u308bURL\u3092\u30af\u30ea\u30c3\u30af<\/li>\n<li>\u8868\u793a\u3055\u308c\u305f\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u65b0\u3057\u3044\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u9001\u4fe1<\/li>\n<li>\u65b0\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u4fdd\u5b58\u3059\u308b<\/li>\n<\/ol>\n<p>\u306a\u304a\u3001\u524d\u56de\u3082\u305d\u3046\u3067\u3059\u304c\u3053\u306e\u6d41\u308c\u306b\u52a0\u3048\u3066\u30b3\u30fc\u30c9\u306f<code>Laravel<\/code>\u3092\u53c2\u8003\u3057\u305f\u3082\u306e\u3067\u3059\u3002<code>Laravel<\/code>\u3055\u3093\u3001\u3044\u3064\u3082\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002m_ _m<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u5fc5\u8981\u306b\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\u304c\u3001\u307b\u307c\u524d\u56de\u8a18\u4e8b\u3068\u540c\u3058\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=5893#i\" target=\"_blank\" rel=\"noopener noreferrer\">\u524d\u63d0\u3068\u3057\u3066<\/a>\u300d\u3092\u53c2\u8003\u306b\u3057\u3066\u4ee5\u4e0b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li>Sequelize<\/li>\n<li>nodemailer<\/li>\n<li>express-validator<\/li>\n<li>bcrypt<\/li>\n<\/ul>\n<p>\u306a\u304a\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30fb\u30a8\u30f3\u30b8\u30f3\u306b\u306f<code>mustache-express<\/code>\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>\u6e96\u5099\u3059\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u306b\u5fc5\u8981\u306aDB\u30c6\u30fc\u30d6\u30eb\u300c<strong>PasswordResets<\/strong>\u300d\u3092\u3064\u304f\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>npx sequelize-cli model:generate --name PasswordReset --attributes email:string,token:string<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\uff12\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li>\/models\/passwordreset.js<\/li>\n<li>\/migrations\/************-create-password-reset.js<\/li>\n<\/ul>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306b\u306f\u3001\u4e0d\u8981\u306a\u9805\u76ee\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u306e\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>'use strict';\r\nmodule.exports = {\r\n  up: (queryInterface, Sequelize) =&gt; {\r\n    return queryInterface.createTable('PasswordResets', {\r\n      email: {\r\n        type: Sequelize.STRING\r\n      },\r\n      token: {\r\n        type: Sequelize.STRING\r\n      },\r\n      createdAt: {\r\n        allowNull: false,\r\n        type: Sequelize.DATE\r\n      }\r\n    });\r\n  },\r\n  down: (queryInterface, Sequelize) =&gt; {\r\n    return queryInterface.dropTable('PasswordResets');\r\n  }\r\n};<\/strong><\/pre>\n<p>\u307e\u305f\u3001\u30e2\u30c7\u30eb\u3082\u540c\u69d8\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u30d7\u30e9\u30a4\u30de\u30ea\u30fc\u30ad\u30fc\u306e\u5909\u66f4\u3084\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\uff09<\/p>\n<pre><strong>'use strict';<\/strong>\r\n<strong>module.exports = (sequelize, DataTypes) =&gt; {<\/strong>\r\n<strong>  const PasswordReset = sequelize.define('PasswordReset', {<\/strong>\r\n<strong>    email: {<\/strong>\r\n<strong>      type: DataTypes.STRING,<\/strong>\r\n<strong>      primaryKey: true<\/strong>\r\n<strong>    },<\/strong>\r\n<strong>    token: DataTypes.STRING,<\/strong>\r\n<strong>    createdAt: DataTypes.DATE<\/strong>\r\n<strong>  }, {<\/strong>\r\n<strong>    timestamps: false,<\/strong>\r\n<strong>  });<\/strong>\r\n<strong>  PasswordReset.associate = function(models) {<\/strong>\r\n<strong>    PasswordReset.hasOne(models.User, {<\/strong>\r\n<strong>      foreignKey: 'email',<\/strong>\r\n<strong>      sourceKey: 'email'<\/strong>\r\n<strong>    });<\/strong>\r\n<strong>  };<\/strong>\r\n<strong>  return PasswordReset;<\/strong>\r\n<strong>};<\/strong><\/pre>\n<p>\u3067\u306f\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u3066DB\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>npx sequelize-cli db:migrate<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5927\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_1.png\" alt=\"\" width=\"346\" height=\"211\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_1.png 346w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_1-300x183.png 300w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/p>\n<h1>\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u30fb\u30e2\u30c7\u30eb\u3092\u8aad\u307f\u8fbc\u3080<\/h1>\n<p><code>app.js<\/code>\u306b\u3001\u4ee5\u4e0b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\uff06\u30e2\u30c7\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u306a\u304a\u3001<code>crypto<\/code>\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4e0d\u8981\u3067\u4f7f\u3048\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\uff09<\/p>\n<pre><strong>const { check, validationResult } = require('express-validator');<\/strong>\r\n<strong>const nodemailer = require('nodemailer');<\/strong>\r\n<strong>const bcrypt = require('bcrypt');<\/strong>\r\n<strong>const crypto = require('crypto');<\/strong>\r\n<strong>const PasswordReset = require('.\/models').PasswordReset;<\/strong>\r\n<strong>const User = require('.\/models').User;<\/strong><\/pre>\n<h1>\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u8a2d\u5b9a\u3059\u308b<\/h1>\n<p>\u540c\u3058\u304f<code>app.js<\/code>\u306b\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066POST\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>app.use(express.json());\r\napp.use(express.urlencoded({ extended: true }));<\/strong><\/pre>\n<h1>\u5fc5\u8981\u306a\u60c5\u5831\u3092\u8ffd\u52a0\u3059\u308b<\/h1>\n<p>\u3053\u3053\u306f\u524d\u56de\u3068\u91cd\u8907\u3057\u307e\u3059\u304c\u3001\u6697\u53f7\u5316\u306b\u3064\u304b\u3046<code>APP_KEY<\/code>\u3001\u30c8\u30c3\u30d7URL\u306e<code>APP_URL<\/code>\u3001\u305d\u3057\u3066\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u60c5\u5831\u306e<code>transporter<\/code>\u3092<code>app.js<\/code>\u306b\u8ffd\u52a0\u3057\u3066\u304a\u304d\u307e\u3059\u3002\uff08\u672c\u6765\u306f<code>.env<\/code>\u3092\u4f7f\u3046\u3079\u304d\u3067\u3059\u304c\u4eca\u56de\u306f\u5272\u611b\u3057\u307e\u3059\uff09<\/p>\n<pre>\/\/ \u6697\u53f7\u5316\u306b\u3064\u304b\u3046\u30ad\u30fc\r\n<strong>const APP_KEY = 'YOUR-SECRET-KEY';<\/strong>\r\n\/\/ \u30c8\u30c3\u30d7URL\r\n<strong>const APP_URL = 'http:\/\/express41.test';<\/strong>\r\n\/\/ \u30e1\u30fc\u30eb\u9001\u4fe1\u8a2d\u5b9a\r\n<strong>const transporter = nodemailer.createTransport({\r\n  host: '127.0.0.1',\r\n  port: 1025,\r\n  secure: '',\r\n  auth: {\r\n    user: '',\r\n    pass: ''\r\n  }\r\n});<\/strong><\/pre>\n<h1>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u9001\u4fe1\u3059\u308b\u30d5\u30a9\u30fc\u30e0\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5fd8\u308c\u305f\u30e6\u30fc\u30b6\u30fc\u304c\u81ea\u5206\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u9001\u4fe1\u3059\u308b\u30d5\u30a9\u30fc\u30e0\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30eb\u30fc\u30c8\u3092<code>app.js<\/code>\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>app.get('\/password\/reset', (req, res) =&gt; {\r\n\r\n  res.render('auth\/passwords\/email');\r\n\r\n});<\/strong><\/pre>\n<p>\u6b21\u306b\u300c<strong>views\/auth\/passwords\/email.mst<\/strong>\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308a\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.4.1\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;div id=\"app\"&gt;\r\n    &lt;div class=\"card-body\"&gt;\r\n        &lt;div class=\"form-group row\"&gt;\r\n            &lt;label for=\"email\" class=\"col-md-4 col-form-label text-md-right\"&gt;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9&lt;\/label&gt;\r\n            &lt;div class=\"col-md-6\"&gt;\r\n                &lt;input type=\"email\" class=\"form-control\" v-model=\"email\"&gt;\r\n                &lt;div class=\"alert alert-danger\" v-if=\"error\" v-text=\"error\"&gt;&lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div class=\"form-group row mb-0\"&gt;\r\n            &lt;div class=\"col-md-6 offset-md-4\"&gt;\r\n                &lt;button type=\"submit\" class=\"btn btn-primary\" @click=\"onSubmit\"&gt;\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u30ea\u30f3\u30af\u3092\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.2\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                email: '',\r\n                error: ''\r\n            },\r\n            methods: {\r\n                onSubmit() {\r\n\r\n                    this.error = '';\r\n\r\n                    axios.post('\/password\/email', { email: this.email })\r\n                        .then(response =&gt; {\r\n\r\n                            if(response.data.result) {\r\n\r\n                                alert('\u5165\u529b\u3055\u308c\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u4fe1\u3057\u307e\u3057\u305f\u3002');\r\n\r\n                            }\r\n\r\n                        })\r\n                        .catch(error =&gt; {\r\n\r\n                            const errors = error.response.data.errors;\r\n\r\n                            errors.every(error =&gt; {\r\n\r\n                                this.error = error.msg;\r\n                                return false;\r\n\r\n                            });\r\n\r\n                        });\r\n\r\n                }\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/strong><\/pre>\n<p>\u4e2d\u8eab\u3068\u3057\u3066\u306f\u3001<code>Vue<\/code>\u3068<code>axios<\/code>\u3092\u4f7f\u3063\u3066\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092<code>Ajax<\/code>\u9001\u4fe1\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u30d6\u30e9\u30a6\u30b6\u3067\u8868\u793a\u3059\u308b\u3068\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5928\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_2.png\" alt=\"\" width=\"640\" height=\"105\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_2.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_2-300x49.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h1>\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306b\u300c<strong>\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u30e1\u30fc\u30eb<\/strong>\u300d\u3092\u9001\u4fe1\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><code>app.js<\/code>\u306b\u4ee5\u4e0b\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3068\u30eb\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>\/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb<strong>\r\nconst passwordEmailValidationRules = [\r\n  check('email')\r\n    .not().isEmpty().withMessage('\u3053\u306e\u9805\u76ee\u306f\u5fc5\u9808\u5165\u529b\u3067\u3059\u3002')\r\n    .isEmail().withMessage('\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5f62\u5f0f\u3067\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002')\r\n    .custom((value, { req }) =&gt; {\r\n\r\n      return User.findOne({\r\n        where: {\r\n          email: req.body.email\r\n        }\r\n      }).then(user =&gt; {\r\n\r\n        if(!user) {\r\n\r\n          throw new Error('\u3053\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306b\u4e00\u81f4\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u3067\u3057\u305f\u3002');\r\n\r\n        }\r\n\r\n      });\r\n\r\n    })\r\n];\r\napp.post('\/password\/email', [passwordEmailValidationRules], (req, res) =&gt; {\r\n\r\n  const errors = validationResult(req);\r\n\r\n  if(!errors.isEmpty()) { <\/strong>\/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u5931\u6557<strong>\r\n\r\n    return res.status(422).json({ errors: errors.array() });\r\n\r\n  }\r\n\r\n  const email = req.body.email;\r\n  const randomStr = Math.random().toFixed(36).substring(2, 38);\r\n  const token = crypto.createHmac('sha256', APP_KEY)\r\n    .update(randomStr)\r\n    .digest('hex');\r\n  const passwordResetUrl = APP_URL +'\/password\/reset\/'+ token +'?email='+ encodeURIComponent(email);\r\n\r\n  PasswordReset.findOrCreate({\r\n    where: {\r\n      email: email\r\n    },\r\n    defaults: {\r\n      email: email,\r\n      token: token,\r\n      createdAt: new Date()\r\n    }\r\n  }).then(([passwordReset, created]) =&gt; {\r\n\r\n    if(!created) {\r\n\r\n      passwordReset.token = token;\r\n      passwordReset.createdAt = new Date();\r\n      passwordReset.save();\r\n\r\n    }\r\n\r\n    <\/strong>\/\/ \u30e1\u30fc\u30eb\u9001\u4fe1<strong>\r\n    transporter.sendMail({\r\n      from: 'from@example.com',\r\n      to: email,\r\n      text: \"\u4ee5\u4e0b\u306eURL\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u518d\u767a\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\\n\\n\"+ passwordResetUrl,\r\n      subject: '\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u30e1\u30fc\u30eb',\r\n    });\r\n    res.json({ result: true });\r\n\r\n  });\r\n\r\n});<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u9001\u4fe1\u3055\u308c\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u6301\u3064\u30e6\u30fc\u30b6\u30fc\u304c\u3044\u308b\u304b\u30c1\u30a7\u30c3\u30af<\/li>\n<li>\u30e6\u30fc\u30b6\u30fc\u304c\u898b\u3064\u304b\u3063\u305f\u3089\u30c8\u30fc\u30af\u30f3\u3092\u3064\u304f\u3063\u3066 PasswordReset \u3078\u4fdd\u5b58<\/li>\n<li>\u30c8\u30fc\u30af\u30f3\u3068\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u542b\u3093\u3060\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884cURL\u300d\u3092\u3064\u304f\u308b<\/li>\n<li>\u305d\u306eURL\u3092\u30e1\u30fc\u30eb\u3067\u9001\u4fe1<\/li>\n<\/ol>\n<h1>\u65b0\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u30d5\u30a9\u30fc\u30e0\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u6b21\u306b\u3001\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884cURL\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306b\u8868\u793a\u3055\u308c\u308b\u30d5\u30a9\u30fc\u30e0\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><code>app.js<\/code>\u306b\u4ee5\u4e0b\u306e\u30eb\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>app.get('\/password\/reset\/:token', (req, res) =&gt; {\r\n\r\n  res.render('auth\/passwords\/reset', {\r\n    token: req.params.token,\r\n    email: req.query.email\r\n  });\r\n\r\n});<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u300c<strong>views\/auth\/passwords\/reset.mst<\/strong>\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u3063\u3066\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.4.1\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;div id=\"app\"&gt;\r\n    &lt;div class=\"card-body\"&gt;\r\n        &lt;div class=\"alert alert-danger\" v-if=\"errors.token\" v-text=\"errors.token\"&gt;&lt;\/div&gt;\r\n        &lt;div class=\"form-group row\"&gt;\r\n            &lt;label for=\"email\" class=\"col-md-4 col-form-label text-md-right\"&gt;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9&lt;\/label&gt;\r\n            &lt;div class=\"col-md-6\"&gt;\r\n                &lt;input type=\"email\" class=\"form-control\" v-model=\"params.email\"&gt;\r\n                &lt;div class=\"alert alert-danger\" v-if=\"errors.email\" v-text=\"errors.email\"&gt;&lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div class=\"form-group row\"&gt;\r\n            &lt;label for=\"password\" class=\"col-md-4 col-form-label text-md-right\"&gt;\u30d1\u30b9\u30ef\u30fc\u30c9&lt;\/label&gt;\r\n            &lt;div class=\"col-md-6\"&gt;\r\n                &lt;input type=\"password\" class=\"form-control\" v-model=\"params.password\"&gt;\r\n                &lt;div class=\"alert alert-danger\" v-if=\"errors.password\" v-text=\"errors.password\"&gt;&lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div class=\"form-group row\"&gt;\r\n            &lt;label for=\"password-confirm\" class=\"col-md-4 col-form-label text-md-right\"&gt;\u30d1\u30b9\u30ef\u30fc\u30c9\uff08\u78ba\u8a8d\uff09&lt;\/label&gt;\r\n            &lt;div class=\"col-md-6\"&gt;\r\n                &lt;input type=\"password\" class=\"form-control\" v-model=\"params.passwordConfirmation\"&gt;\r\n                &lt;div class=\"alert alert-danger\" v-if=\"errors.passwordConfirmation\" v-text=\"errors.passwordConfirmation\"&gt;&lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div class=\"form-group row mb-0\"&gt;\r\n            &lt;div class=\"col-md-6 offset-md-4\"&gt;\r\n                &lt;button type=\"submit\" class=\"btn btn-primary\" @click=\"onSubmit\"&gt;\u767b\u9332\u3059\u308b&lt;\/button&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.2\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                params: {\r\n                    token: '{{ token }}',\r\n                    email: '{{ email }}',\r\n                    password: '',\r\n                    passwordConfirmation: ''\r\n                },\r\n                errors: {}\r\n            },\r\n            methods: {\r\n                onSubmit() {\r\n\r\n                    this.errors = {\r\n                        token: '',\r\n                        email: '',\r\n                        password: '',\r\n                        passwordConfirmation: ''\r\n                    };\r\n\r\n                    axios.post('\/password\/reset', this.params)\r\n                        .then(response =&gt; {\r\n\r\n                            if(response.data.result) {\r\n\r\n                                alert('\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u30ea\u30bb\u30c3\u30c8\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002');\r\n\r\n                            }\r\n\r\n                        })\r\n                        .catch(error =&gt; {\r\n\r\n                            const errors = error.response.data.errors;\r\n\r\n                            errors.forEach(error =&gt; {\r\n\r\n                                const key = error.param;\r\n\r\n                                if(this.errors[key] === '') {\r\n\r\n                                    this.errors[key] = error.msg;\r\n\r\n                                }\r\n\r\n                            });\r\n\r\n                        });\r\n\r\n                }\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u306f\u3001\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u300d\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\uff08\u78ba\u8a8d\uff09\u300d\u306e\uff13\u7a2e\u985e\u3092\u5165\u529b\u3057\u3066\u3082\u3089\u3044\u3001\u6700\u7d42\u7684\u306b<code>token<\/code>\u3082\u81ea\u52d5\u8ffd\u52a0\u3057\u3066\u9001\u4fe1\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\uff08<code>Vue<\/code>\u306e<code>data<\/code>\u306b\u76f4\u63a5\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3001\u30c8\u30fc\u30af\u30f3\u3092\u6e21\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<h1>\u65b0\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u6700\u5f8c\u306b\u9001\u4fe1\u3055\u308c\u305f\u65b0\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\n<span style=\"font-size: 1rem;\">\u3053\u3053\u3067\u3082<\/span><code>app.js<\/code><span style=\"font-size: 1rem;\">\u306b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3068\u30eb\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/span><\/p>\n<pre>\/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\r\n<strong>const passwordResetValidationRules = [\r\n  check('email')\r\n    .not().isEmpty().withMessage('\u3053\u306e\u9805\u76ee\u306f\u5fc5\u9808\u5165\u529b\u3067\u3059\u3002')\r\n    .isEmail().withMessage('\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5f62\u5f0f\u3067\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002')\r\n    .custom((value, { req }) =&gt; {\r\n\r\n      return User.findOne({\r\n        where: {\r\n          email: req.body.email\r\n        }\r\n      }).then(user =&gt; {\r\n\r\n        if(!user) {\r\n\r\n          throw new Error('\u3053\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306b\u4e00\u81f4\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u3067\u3057\u305f\u3002');\r\n\r\n        }\r\n\r\n      });\r\n\r\n    }),\r\n  check('password')\r\n    .not().isEmpty().withMessage('\u3053\u306e\u9805\u76ee\u306f\u5fc5\u9808\u5165\u529b\u3067\u3059\u3002')\r\n    .isLength({ min:8, max:25 }).withMessage('8\u6587\u5b57\u304b\u308925\u6587\u5b57\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002')\r\n    .custom((value, { req }) =&gt; {\r\n\r\n      if(req.body.password !== req.body.passwordConfirmation) {\r\n\r\n        throw new Error('\u30d1\u30b9\u30ef\u30fc\u30c9\uff08\u78ba\u8a8d\uff09\u3068\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002');\r\n\r\n      }\r\n\r\n      return true;\r\n\r\n    })\r\n];\r\n<\/strong>\r\n<strong>app.post('\/password\/reset', [passwordResetValidationRules], (req, res) =&gt; {\r\n\r\n  const errors = validationResult(req);\r\n\r\n  if(!errors.isEmpty()) { \/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u5931\u6557\r\n\r\n    return res.status(422).json({ errors: errors.array() });\r\n\r\n  }\r\n\r\n  const email = req.body.email;\r\n  const password = req.body.password;\r\n  const token = req.body.token;\r\n\r\n  PasswordReset.findOne({\r\n    where: {\r\n      email: email\r\n    },\r\n    include: [\r\n      { model: User }\r\n    ]\r\n  }).then(passwordReset =&gt; {\r\n\r\n    if(passwordReset &amp;&amp;\r\n      passwordReset.token === token &amp;&amp;\r\n      passwordReset.User) {\r\n\r\n      const user = passwordReset.User;\r\n      user.password = bcrypt.hashSync(password, bcrypt.genSaltSync(8));\r\n      user.save();\r\n      passwordReset.destroy();\r\n\r\n      res.json({ result: true });\r\n\r\n    } else {\r\n\r\n      return res.status(422).json({\r\n        errors: [\r\n          {\r\n            value: '',\r\n            msg: '\u3053\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u30ea\u30bb\u30c3\u30c8\u30c8\u30fc\u30af\u30f3\u306f\u7121\u52b9\u3067\u3059\u3002',\r\n            param: 'token',\r\n            location: 'body'\r\n          }\r\n        ]\r\n      });\r\n\r\n    }\r\n\r\n  });\r\n\r\n});<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u306e\u6d41\u308c\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u6b63\u3057\u3044\u304b\u30c1\u30a7\u30c3\u30af<\/li>\n<li>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u60c5\u5831\u3092\u53d6\u5f97<\/li>\n<li>\u3082\u3057\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3057\u3066\u3044\u308c\u3070\u3001\u65b0\u3057\u3044\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u6697\u53f7\u5316\uff08\u30cf\u30c3\u30b7\u30e5\u5316\uff09\u3002\u65b0\u30d1\u30b9\u30ef\u30fc\u30c9\u3068\u3057\u3066\u4fdd\u5b58<\/li>\n<\/ol>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<p>\u307e\u305a<code>\/password\/reset<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5936\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_3.png\" alt=\"\" width=\"640\" height=\"102\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_3.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_3-300x48.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u30a2\u30c3\u30d7\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5934\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_5.png\" alt=\"\" width=\"521\" height=\"209\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_5.png 521w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_5-300x120.png 300w\" sizes=\"auto, (max-width: 521px) 100vw, 521px\" \/><\/p>\n<p>\u30e1\u30fc\u30eb\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5933\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_6.png\" alt=\"\" width=\"471\" height=\"209\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_6.png 471w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_6-300x133.png 300w\" sizes=\"auto, (max-width: 471px) 100vw, 471px\" \/><\/p>\n<p>\u30e1\u30fc\u30eb\u306b\u66f8\u304b\u308c\u3066\u3044\u308bURL\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u300d\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\uff08\u78ba\u8a8d\uff09\u300d\u3092\u5165\u529b\u3057\u307e\u3059\u3002\uff08\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u81ea\u52d5\u5165\u529b\u3055\u308c\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5932\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_7.png\" alt=\"\" width=\"640\" height=\"188\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_7.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_7-300x88.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u9001\u4fe1\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5942\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_4.png\" alt=\"\" width=\"518\" height=\"182\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_4.png 518w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/02\/express_password_reminder_4-300x105.png 300w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><\/p>\n<p>\u306f\u3044\uff01<br \/>\n\u5168\u3066\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\ud83d\ude0a\u2728<\/p>\n<h1>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u958b\u767a\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b\u305f\u3060\u3057\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30fb\u30a8\u30f3\u30b8\u30f3\u306e\u8a2d\u5b9a\u306a\u3069\u306f\u3054\u81ea\u8eab\u3067\u884c\u3063\u3066\u3044\u305f\u3060\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=5937&amp;tmstv=1777532619\" rel=\"nofollow\" id=\"download-link-5937\" data-redirect=\"false\" >\n\tExpress\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u6a5f\u80fd\u3092\u3064\u304f\u308b<\/a>\n\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u524d\u56de\u306b\u5f15\u304d\u7d9a\u304d<code>Express<\/code>\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u518d\u767a\u884c\u6a5f\u80fd\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u7d50\u679c\u3068\u3057\u3066\u60f3\u50cf\u3088\u308a\u3082\u305f\u304f\u3055\u3093\u3084\u308b\u3053\u3068\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u6b63\u76f4\u6bce\u56de\u3053\u3093\u306a\u30b3\u30fc\u30c9\u3092\u76f4\u306b\u66f8\u3044\u3066\u3044\u305f\u3089\u3081\u3093\u3069\u3046\u3060\u306a\u30fc\ud83d\udca6 \u306a\u3093\u3066\u601d\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3082\u3046\u3044\u3063\u305d\u306e\u3053\u3068\u3001<code>Express<\/code>\u306e\u65b9\u3067\u300c\u30ed\u30b0\u30a4\u30f3\u300d\u300c\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u300d\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u300d\u306f\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3057\u3066\u304a\u3044\u3066\u3001<code>Laravel<\/code>\u306e\u3088\u3046\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070\u3059\u3050\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308c\u3070\u3044\u3044\u306e\u306b\u306a\u30fb\u30fb\u30fb\u306a\u3093\u3066\u52dd\u624b\u306b\u601d\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\uff08\u81ea\u5206\u3067\u3084\u308b\u3079\u304d\uff1f\uff1f\u30fb\u30fb\u30fb\u3046\u30fc\u3093\u3001\u3001\u3001\u691c\u8a0e\u3057\u3066\u307f\u307e\u3059\ud83d\ude05\uff09<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3467 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png\" alt=\"\" width=\"216\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png 216w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9-203x300.png 203w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8b\u300cExpress\u3067\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u6a5f\u80fd\u300d\u3067\u3082\u5c11\u3057\u89e6\u308c\u307e\u3057\u305f\u304c\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u6a5f\u80fd\u3092\u3064\u304f\u308b\u969b\u306b\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u6a5f\u80fd\u300d\u3001\u3044\u308f\u3086\u308b\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u30fb\u30ea\u30de\u30a4\u30f3 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=5923\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Express\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u6a5f\u80fd\u3092\u3064\u304f\u308b\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\uff09&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":5941,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[201,97],"tags":[125],"class_list":["post-5923","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-express","category-97","tag-125"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5923","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=5923"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5923\/revisions"}],"predecessor-version":[{"id":6062,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5923\/revisions\/6062"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/5941"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}