An extremely lightweight and fast http server
Project description
FastHttpServer - Simple, Lightweight, and Fast HTTP Server
Overview
FastHttpServer is a pip package that offers a simple, lightweight, and fast HTTP server implemented in Python. This server provides a minimalistic solution for serving static content and handling basic HTTP requests. It is designed to be easy to set up, efficient in serving web content, and accessible as a pip-installable package.
Installation
To install FastHttpServer, use the following pip command:
pip install FastHttpServer
Also make sure the python 'socket' package is installed
Usage
- After installation, you can import the package:
import FastHttpServer
- To run the server use the initServer() function and specify the port:
FastHttpServer.initServer(3000)
This will make the server listen on localhost at port 3000. You can customize the port by changing the port parameter.
- Access the server in your browser:
Open your web browser and navigate to http://localhost:3000 (or the custom port you specified). You should see a 404 page indicating that the server is running.
- Specify the routes of the server
use the route wrapper and specify the route path. Make sure the proceeding function has a request parameter:
@FastHttpServer.route('/')
def index(request):
return '<h1>Success!</h1>'
Notes
-
This server is suitable for serving static content in development and testing environments. For production use, consider security and scalability aspects.
-
FastHttpServer is intentionally kept minimalistic. For more advanced features and dynamic content, consider using a full-fledged web framework.
Feel free to use and contribute to FastHttpServer. Keep your web serving simple and enjoy the speed!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file FastHttpServer-0.0.1.tar.gz.
File metadata
- Download URL: FastHttpServer-0.0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d534baff384babf06d9056a73d485e847976c33d07ead12bcf2d4ec8e070f7b
|
|
| MD5 |
81ba54b834bdff2bdecb6556642e60c7
|
|
| BLAKE2b-256 |
1a62cdaef2f7396789484161183f4845a34fb72f27a233d9ed12f0408a5f0f7c
|
File details
Details for the file FastHttpServer-0.0.1-py3-none-any.whl.
File metadata
- Download URL: FastHttpServer-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
109815750ae36ed4e8b051e767f962d03622b8d06fe4cba788f071476631a383
|
|
| MD5 |
1f5904715b232e07673d6a9fcd762242
|
|
| BLAKE2b-256 |
58c4f96d85538351c8e43dee1384f5bf3a1db4d36d0f93e69c82db7ed1e151d9
|