Skip to main content

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

  1. After installation, you can import the package:
import FastHttpServer
  1. 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.

  1. 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.

  1. 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

FastHttpServer-0.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FastHttpServer-0.0.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

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

Hashes for FastHttpServer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8d534baff384babf06d9056a73d485e847976c33d07ead12bcf2d4ec8e070f7b
MD5 81ba54b834bdff2bdecb6556642e60c7
BLAKE2b-256 1a62cdaef2f7396789484161183f4845a34fb72f27a233d9ed12f0408a5f0f7c

See more details on using hashes here.

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

Hashes for FastHttpServer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 109815750ae36ed4e8b051e767f962d03622b8d06fe4cba788f071476631a383
MD5 1f5904715b232e07673d6a9fcd762242
BLAKE2b-256 58c4f96d85538351c8e43dee1384f5bf3a1db4d36d0f93e69c82db7ed1e151d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page