Pythonでサーバー構築

概要

ブログを書いているとJavaScriptを勉強したくなったのでそのための環境を整えるためにpythonでサーバーを構築する。

参照記事

python でお気楽Webサーバを構築してCGIのテスト。

環境

macOS Mojave 10.14.5
python 3.7.4

htmlを書く

index.htmlを作成する。

<html>
    <head>
        <title>
            Title: Hello Python
        </title>
    </head>
    <body>
        <h1>Hello Python</h1>
    </body>
</html>

Sever構築

$ python -m http.server 8080

http://localhost:8080/ へアクセス!