Nirum services as WSGI apps
Project description
Nirum services as WSGI apps
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a468529dcd671f53d539b7c0a5939cc934ad9ef60afae61b9276191cfabeb9f |
|
MD5 | 16ccd253a3272155ca459f3466219bbf |
|
BLAKE2b-256 | d6221fa09a77bb3a84bfb41627727d742cef58a79f948187c4005dd58754ec4a |
File details
Details for the file nirum_wsgi-0.2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: nirum_wsgi-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9015794fc600ccbfd14b5d2cb04eec37ad946283128c482be344294be5a2b8c |
|
MD5 | 7e86dfcc9f11a11eebcc4de9dbf9a453 |
|
BLAKE2b-256 | d2665c9a0960183bfd200f82e9d62af090fa14eed8b7c3b36da1c0d64c60286b |