Skip to main content

Simple way to make complex HTTP servers with python

Project description

Project Description

HTTP-PyServer is a simple, and extremly light-weight solution to create powerful projects relying on the web with few lines of code. It uses python built-in packages to host server's and then handle http requests, as well as responses. It's extremely customizable, and allows you do to almost everything you might want.

HTTP-PyServer is also very flexible on your project layout. It ensures security by allowing you to specify which files to send, and to where. HTTP-PyServer allows you to do everything you need whilst keeping hands relaxed with as few lines of code as possible.

Installing

Install HTTP-PyServer using pip from the command line.

python -m pip install HTTP-PyServer

Simple Example

# Saved as "main.py"
from server import Routes, text, run

@Routes.route(path = '/')
def home(request):

    return text(text = 'Hello, world!')

if __name__ == '__main__':

    run()
$ python main.py
Press enter to exit...

Contributing

Look on github, and create a fork of HTTP-PyServer. Submit, pull requests, and any features will be looked at, and potentially implemented.

Used Packages

Although, no external packages were used, the following packages were imported. All packages are native in Python 3.11.2. Not tested on any other versions, however it should work.

  • threading
  • socket
  • sys
  • logging
  • os
  • urllib
  • mimetypes
  • enum

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

HTTP-PyServer-0.0.4.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

HTTP_PyServer-0.0.4-py3-none-any.whl (9.4 kB view hashes)

Uploaded Python 3

Supported by

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