Skip to content

pedramcode/RHTTP-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RHTTP-python

Python interface for RHTTP server

Installation

Install the latest version of rhttp-python with running installation command:

pip install rhttp-python

Usage

First you need to import required package:

# RHTTP server
from rhttp_python import RHTTPServer

First you need to create server by passing redis host and port:

server = RHTTPServer("127.0.0.1", 6379)

Then you can define endpoints using route decorator

@server.route("/", "GET")
def home(req, res):
    print(req)
    return res.status(200).content_type("text/html").send("<h1>test</h1>")

First parameter of decorator is "path" of endpoint and second is http method

At the end you need run server:

server.listen()

License

This project is licensed under the terms of the MIT License. See the LICENSE file for details.

About

RHTTP python interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages