thanethomson / httpwatcher

Python-based HTTP server for static files with live reload
MIT License
20 stars 10 forks source link

please support "python -m httpwatcher" #9

Open hananbeer opened 3 years ago

hananbeer commented 3 years ago

I use "python -m http.server" a lot. your solution is exactly what I needed. I found a no-brainer solution to support "-m" flag, just add the following file run.py:

# -*- coding:utf-8 -*-
import httpwatcher
httpwatcher.watch('.')

and you can run "python -m httpwatcher.run"

jobveldhuis commented 3 years ago

The easiest solution to this would be to add a __main__.py file with the exact code above. How do you feel about this? @thanethomson

thanethomson commented 3 years ago

Sure, sounds good :+1:

jobveldhuis commented 3 years ago

The latest version of the dev branch now contains a simple Python script that allows you to call:

python -m httpwatcher