This project is a lightweight file server built using Pythonβs built-in http.server module. It serves files from a files/ directory and features a sleek web interface with a refresh server button that restarts the server process on demand.
- π Serves files from a local
files/folder - π» Clean and responsive HTML/CSS interface
- π One-click server restart via web UI
- βοΈ Built with Python standard libraries (no external dependencies)
- π§ Automatically lists files in the UI with download links
your_project/
βββ server.py # Main server script
βββ files/ # Directory to store and serve files
- Python 3.x
β No external packages are needed β everything runs using Pythonβs built-in modules.
-
Create a folder named
filesin the same directory asserver.py. -
Place any files you want to share in the
filesfolder. -
Run the server by executing:
python server.py
-
Open your browser and go to:
http://localhost:8080
server.pyuses Pythonβshttp.servermodule with a custom handler.- The server serves files from the
files/directory. - It generates an HTML interface with:
- A welcome message
- A list of downloadable files
- A button to "Refresh Server"
- The
/refreshroute restarts the server process viasubprocessandos._exit.
To stop the server at any time, press:
Ctrl + CThis project is open source and free to use. Feel free to modify or extend it.
Rahul Kuzur β Made with β€οΈ using Python.