Skip to main content

Simple wrapper around gevent's wsgi server.Adds simple regex routing, error handling, and json/jsonp handling.

Project description

gserver 0.1.0

Simple wrapper around gevent that provides a basic routing engine and JSON/JSONP handling.

Here’s a simple usage example:

from gserver import Routes
from gserver.wsgi import WSGIServer, parse_vals

routes = Routes()
route = routes.route
route_json = routes.route_json

@route('^/example/$')
def example(env, resp):
        return "hello"

@route_json('^/example/(?P<name>\w+)/$', method='GET,POST')
def example_name(env, resp, name=None):
        query_age, query_height = parse_vals(env, 'age', 'height')

        return { 'name': name,
                         'age': query_age,
                         'height': query_height }

if __name__ == "__main__":
        server = WSGIServer('', 9191, routes, log=None)
        server.serve_forever()

get gserver

Install gevent, and it’s dependencies greenlet and libevent

Download the latest release from Python Package Index or clone the repository

More documentation is on it’s way (check the site for updates)

Provide any feedback and issues on the bug tracker, that should be coming soon.

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

gserver-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

File details

Details for the file gserver-0.1.0.tar.gz.

File metadata

  • Download URL: gserver-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gserver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9943f1a72af17e929d36daf8a66ac643ee317b4d7da185d830e00f01dc7e3d8e
MD5 6c91c97d0ca86d250531b67347c6c725
BLAKE2b-256 42cfb62fc4a92e7084d2985edec390ad7c1939c58fa551bec957934d487d6858

See more details on using hashes here.

Supported by

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