0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Express】Node.js Webアプリケーションフレームワーク 基本

Last updated at Posted at 2023-05-22

ルーティングはapp.getで行う
res.render('ファイル名')とすることで定したビューファイルをブラウザに表示可能
req:リクエスト
res:レスポンス

app.js
const express = require('express');
const app = express();

// トップ画面を表示するルーティング
app.get('/top', (req, res) => {
  res.render('top.ejs');
});
app.listen(3000);
  • ミドルウェア関数:入力値が空かどうかをチェックする
  • パスワードのハッシュ化:ユーザーの入力した普通の文字列のパスワードと、データベース上のハッシュ化されたパスワードを比較するにはbcryptパッケージのcompareメソッドを使う
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?