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.2

Released on March 20, 2018.

  • Fixed a runtime TypeError that had been raised when a parameter corresponding to a variable for a query string in @http-resource annotation’s path has an optional type. [#251 by Chang-soo Han]

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.2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nirum_wsgi-0.2.2-py2.py3-none-any.whl (12.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for nirum-wsgi-0.2.2.tar.gz
Algorithm Hash digest
SHA256 67585577b35e286272b34232f1fa67256854eba5c51a6fc713271202a314f9e4
MD5 1f517111d113195e6b6ef0863510cec7
BLAKE2b-256 b0beff859a3106bebdaa7d5280205d346f635a3f62663b0e51533001c1da2796

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nirum_wsgi-0.2.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 62e086c7c5142097befb1080bdf088403360b6c40534a459644def522e9d1f85
MD5 f17cbed205104ae97495132a27fec471
BLAKE2b-256 f99a1da4d3225f64c0a4a6ee27d4bebda9c132a53f329bf5d5c58e448ec38f1d

See more details on using hashes here.

Supported by

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