urlrelay

RESTful WSGI URL dispatcher.
Download

urlrelay Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • L. C. Rees

urlrelay Tags


urlrelay Description

RESTful WSGI URL dispatcher. urlrelay is a simple URL dispatcher that passes HTTP requests to a WSGI application based on a matching URL path regex pattern and an optional HTTP request method. Usage example: #!/bin/env pythonimport urlrelay# Simple URL to application mappingurlrelay.url('^/$')def index(environ, start_response): start_response('200 OK', ) return # "RESTful" URL to application mappingurlrelay.url('^/hello_world$', 'GET')def hello_world(environ, start_response): start_response('200 OK', ) return # URL to on-disk application mapping# urlrelay.register('^/ondisk$', 'module.on_disk')if __name__ == '__main__': from wsgiref.simple_server import make_server http = make_server('', 8080, urlrelay.URLRelay()) http.serve_forever() Requirements: · Python


urlrelay Related Software