2023.01.21 参照YouTube: https://www.youtube.com/watch?v=Zk7tpzaKv0U
■Expressフレームワークの準備 1.GitHubリポジトリ作成(express-tutorial) 2.VScodeで初期化(>npm init -y)で、package.json作成 3.VScodeでexpressとnodemonをインストール(>npm i express nodemon) 4.VScodeでサーバの起動(>npm run dev)
■ExpressでWebアプリケーションの作成 1.サーバの起動 const express = require("express"); const app = express(); const PORT = 3000;
app.listen(PORT, () => console.log("..."));
2.GETメソッド追加 app.get("/", (req, res) => { res.status(500).json((msg: "エラーです"); });