{"id":196,"date":"2020-10-20T00:44:25","date_gmt":"2020-10-19T15:44:25","guid":{"rendered":"http:\/\/localhost:8000\/?p=196"},"modified":"2021-01-16T00:55:02","modified_gmt":"2021-01-15T15:55:02","slug":"serve-static-files","status":"publish","type":"post","link":"http:\/\/localhost:8000\/2020\/10\/serve-static-files.html","title":{"rendered":"\u30ed\u30fc\u30ab\u30ebPC\u3067WEB\u30b5\u30fc\u30d0\u3092\u7acb\u3061\u4e0a\u3052\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u3092SERVE\u3059\u308b4\u3064\u306e\u65b9\u6cd5"},"content":{"rendered":"

\u6700\u8fd1\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3059\u308b\u3053\u3068\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u3001\u958b\u767a\u6642\u306b\u52d5\u4f5c\u78ba\u8a8d\u306e\u305f\u3081\u306b\u6761\u4ef6\u306b\u5408\u3046WEB\u30b5\u30a4\u30c8\u3092\u63a2\u3057\u51fa\u3059\u306e\u304c\u5927\u5909\u306a\u306e\u3067\u3001\u30ed\u30fc\u30ab\u30ebPC\u4e0a\u3067WEB\u30b5\u30fc\u30d0\u3092\u7acb\u3061\u4e0a\u3052\u3066\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u3092SERVE\u3057\u305f\u304f\u306a\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002
\n\u30ed\u30fc\u30ab\u30ebPC\u3067\u7c21\u5358\u306b\u9759\u7684WEB\u30b5\u30fc\u30d0\u3092\u7acb\u3061\u4e0a\u3052\u308b\u65b9\u6cd5\u3092\uff14\u3064\u307b\u3069\u7d39\u4ecb\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

VS Code \u306e Live Server\uff08\u304a\u3059\u3059\u3081\uff09<\/h2>\n

\u81ea\u5206\u306f\u77e5\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001VS Code\u306e\u62e1\u5f35\u6a5f\u80fd\u3067Live Server<\/a>\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\u9759\u7684\u304a\u3088\u3073\u52d5\u7684\u30da\u30fc\u30b8\u306e\u30e9\u30a4\u30d6\u30ea\u30ed\u30fc\u30c9\u6a5f\u80fd\u3092\u5099\u3048\u305f\u30ed\u30fc\u30ab\u30eb\u958b\u767a\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u3066\u304f\u308c\u308b\u62e1\u5f35\u6a5f\u80fd\u3067\u3059\u3002\u3053\u3061\u3089\u306b\u7279\u5fb4<\/a>\u304c\u5217\u6319\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n

VS Code\u306eExtensions\u304b\u3089Live Server\u3092\u691c\u7d22\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/p>\n

\u4f7f\u3044\u65b9<\/h3>\n

\u4e00\u756a\u304a\u624b\u8efd\u306a\u65b9\u6cd5\u306f\u3001\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001Open with Live Server<\/code>\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002
\n\"\"<\/p>\n

\u30b5\u30fc\u30d0\u30fc\u304c\u7acb\u3061\u4e0a\u304c\u308a\u3001\u81ea\u52d5\u7684\u306b\u30d6\u30e9\u30a6\u30b6\u3067\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u3092OPEN\u3057\u3066\u304f\u308c\u307e\u3059\u3002
\n\"\"<\/p>\n

\u7acb\u3061\u4e0a\u304c\u3063\u305f\u30b5\u30fc\u30d0\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306fworkspace\u5168\u4f53\u3092\u516c\u958b\u3057\u307e\u3059\u3002<\/p>\n

\u8a2d\u5b9a<\/h3>\n

\u7279\u306b\u8a2d\u5b9a\u3057\u306a\u304f\u3066\u3082\u3044\u3044\u3068\u3082\u3044\u307e\u3059\u304c\u3001\u30dd\u30fc\u30c8\u756a\u53f7\u30fb\u5bfe\u8c61\u30d5\u30a9\u30eb\u30c0\u5909\u66f4\u3001https\u5bfe\u5fdc\u306a\u3069\u3092\u3084\u308a\u305f\u3044\u5834\u5408\u3001.vscode\/settings.json<\/code>\u306b\u3066\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002\u8a2d\u5b9a\u3067\u304d\u308b\u5185\u5bb9\u306f\u3053\u3061\u3089<\/a>\u3092\u53c2\u7167\u306e\u3053\u3068\u3002<\/p>\n

{\n    "liveServer.settings.port": 9000,\n    "liveServer.settings.root": "\/files\/",\n    "liveServer.settings.https": {\n        "enable": true,\n        "cert": "\/hoge\/fuga\/server.cert",\n        "key": "\/hoge\/fuga\/server.key",\n        "passphrase": "xxxxx"\n    },\n},<\/code><\/pre>\n

Charset\u306e\u6271\u3044<\/h3>\n

UTF-8\u4ee5\u5916\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3082Content-Type: text\/html; charset=UTF-8<\/code>\u306e\u3088\u3046\u306bcharset\u304c\u5f37\u5236\u7684\u306bUTF-8\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3001\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u70b9\u3092\u89e3\u6d88\u3059\u308b\u65b9\u6cd5\u304c\u306a\u3055\u305d\u3046\u3067\u3059\u3002\u3002<\/p>\n

\u3044\u3044\u3068\u3053\u308d<\/h3>\n