Skip to main content

Nirum services as WSGI apps

Project description

Nirum services as WSGI apps

Build status Latest PyPI version

This package provides nirum_wsgi.WsgiApp class which adapts a given Nirum service to a WSGI application:

from youtservice import YourService
from nirum_wsgi import WsgiApp

class YourServiceImpl(YourService):
    ...

app = WsgiApp(YourServiceImpl())

There’s a development-purpose CLI launcher named nirum-server as well:

nirum-server -H 0.0.0.0 -p 8080 --debug 'yourserviceimpl:YourServiceImpl()'

Changelog

Version 0.2.1

Released on March 20, 2018.

  • Fixed a runtime re.error (sre_constants.error) that had been raised when a variable name for a query string has one or more hyphens in @http-resource annotation’s path. [#250 by Chang-soo Han]

Version 0.2.0

Released on February 4, 2018.

  • Made parameters having an optional type possible to be omitted. [#205]

  • Added method dispatching by querystring pattern e.g., @http-resource(method="GET", path="/users?from={from}&to={to}"). [#130]

  • Added basic method dispatching by path pattern (URI template) through http-resource annotation, e.g., @http-resource(method="GET", path="/users/{login}/works/{work-id}/"). [#130]

  • Added allowed_origins and allowed_headers options for CORS to WsgiApp constructor. It supports simple wildcard (*) pattern syntax as well.

  • Added AnnotationError, NoJsonError, and ServiceMethodError exceptions.

  • Since returning a disallowed value which does not match to the return type is the fault the server-side made, the HTTP status code for the case became 500 Internal Server Error instead of 400 Bad Request. Also now it writes logs using logging module.

  • For the mistakes returning None from a method having non-null return type, now it became to show a more readable and debug-friendly message with a proper response instead of uncaught Python exception.

  • WsgiApp.url_map attribute was gone.

  • /ping/ resource was gone.

  • Fixed nirum-server command able to import a Python module/package from the current working directory (.; CWD).

Version 0.1.0

Released on July 10, 2017.

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

nirum-wsgi-0.2.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

nirum_wsgi-0.2.1-py2.py3-none-any.whl (12.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nirum-wsgi-0.2.1.tar.gz.

File metadata

  • Download URL: nirum-wsgi-0.2.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nirum-wsgi-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0a468529dcd671f53d539b7c0a5939cc934ad9ef60afae61b9276191cfabeb9f
MD5 16ccd253a3272155ca459f3466219bbf
BLAKE2b-256 d6221fa09a77bb3a84bfb41627727d742cef58a79f948187c4005dd58754ec4a

See more details on using hashes here.

File details

Details for the file nirum_wsgi-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for nirum_wsgi-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f9015794fc600ccbfd14b5d2cb04eec37ad946283128c482be344294be5a2b8c
MD5 7e86dfcc9f11a11eebcc4de9dbf9a453
BLAKE2b-256 d2665c9a0960183bfd200f82e9d62af090fa14eed8b7c3b36da1c0d64c60286b

See more details on using hashes here.

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