{ "info": { "author": "Luciano Ratamero", "author_email": "luciano@ratamero.com", "bugtrack_url": null, "classifiers": [], "description": "apistar_cors_hooks\n==================\n\n.. image:: https://travis-ci.org/lucianoratamero/apistar_cors_hooks.svg?branch=master\n :target: https://travis-ci.org/lucianoratamero/apistar_cors_hooks\n\nThis project enables CORS on `API Star`_\\ apps via event hooks.\n\nSuppports:\n\n- apistar>=0.4.0\n- python>=3.6\n\nInstallation\n~~~~~~~~~~~~\n\nInstall via PyPI:\n\n.. code:: shell\n\n pip install apistar_cors_hooks\n\n\nAfter installing, we need to add and instance of ``CORSRequestHooks`` to your ``event_hooks`` in your app:\n\n.. code:: python\n\n from apistar import App, Route\n from apistar_cors_hooks import CORSRequestHooks\n\n\n def homepage() -> str:\n return '

Homepage

'\n\n\n routes = [\n Route('/', method='GET', handler=homepage),\n ]\n\n event_hooks = [CORSRequestHooks()]\n app = App(routes=routes, event_hooks=event_hooks)\n\nIf you want to customize WSGICORS options, you just need to pass a dict via the ``options`` kwarg:\n\n.. code:: python\n\n custom_options = {\"origin\": \"your_host_server\"}\n event_hooks = [CORSRequestHooks(options=custom_options)]\n app = App(routes=routes, event_hooks=event_hooks)\n\n\nContributing\n~~~~~~~~~~~~\n\nSince I'm a WSGI/CORS noob, I may have left a bug or two, or didn't think of better ways to implement this.\n\nBe free to open an issue, contribute with PRs and contact me at ``luciano@ratamero.com``.\n\n.. _API Star: https://github.com/encode/apistar\n\n\nChangelog\n~~~~~~~~~~~~\n\n0.1.1\n'''''\n- adds README.rst as long description on PyPI\n\n0.1.0\n'''''\n- initial version\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lucianoratamero/apistar_cors_hooks", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "apistar-cors-hooks", "package_url": "https://pypi.org/project/apistar-cors-hooks/", "platform": "", "project_url": "https://pypi.org/project/apistar-cors-hooks/", "project_urls": { "Homepage": "https://github.com/lucianoratamero/apistar_cors_hooks" }, "release_url": "https://pypi.org/project/apistar-cors-hooks/0.1.1/", "requires_dist": [ "apistar (>=0.4)", "wsgicors (<0.8,>=0.7)" ], "requires_python": ">=3.6", "summary": "CORS support for API Star via event hooks.", "version": "0.1.1" }, "last_serial": 3786339, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "70192b9650594e4debcd41b1496d3cb1", "sha256": "fa60709c3f252b3a995750e895abc156ea12a43226f1452641468c4fde82d91d" }, "downloads": -1, "filename": "apistar_cors_hooks-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "70192b9650594e4debcd41b1496d3cb1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 2977, "upload_time": "2018-04-21T00:58:03", "url": "https://files.pythonhosted.org/packages/0f/6c/e1a76e0f224692b827ea04a0f0c6a6946bbd2650f9822c844162213dc2af/apistar_cors_hooks-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19214ad228935ab0e53ec0ae0748f259", "sha256": "b27c653ca3f1633b9405f5563a5e1aefdbcff3c595aa9a64b827058bbb828d06" }, "downloads": -1, "filename": "apistar_cors_hooks-0.1.0.tar.gz", "has_sig": false, "md5_digest": "19214ad228935ab0e53ec0ae0748f259", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2338, "upload_time": "2018-04-21T00:58:04", "url": "https://files.pythonhosted.org/packages/f0/d8/1056fc8109dd926b51691133ab029d2dc4762f6cb14f60bc9accdb6854ea/apistar_cors_hooks-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a244e1a34f4d1eacd54b418008a145dc", "sha256": "f675de38bc550b3238b8a5ece39b2caf32a29292eb10bd67d562a7dc847c8cbd" }, "downloads": -1, "filename": "apistar_cors_hooks-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a244e1a34f4d1eacd54b418008a145dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 3626, "upload_time": "2018-04-21T01:27:55", "url": "https://files.pythonhosted.org/packages/3c/99/8c89672b2338c04f685545f95712a304f54c7986d387ab676e8c72f04ac8/apistar_cors_hooks-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e63a479eaac6168d1e4315d35e3c14f", "sha256": "7e4cb7d62ed0348993cce9845df08ba39538269ebf5d9e2dc2c551fd20946d6d" }, "downloads": -1, "filename": "apistar_cors_hooks-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8e63a479eaac6168d1e4315d35e3c14f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2591, "upload_time": "2018-04-21T01:27:56", "url": "https://files.pythonhosted.org/packages/07/e2/2ed80657b26ceea89e7215e855df799d30890ecf1ecf18ea5684880d4861/apistar_cors_hooks-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a244e1a34f4d1eacd54b418008a145dc", "sha256": "f675de38bc550b3238b8a5ece39b2caf32a29292eb10bd67d562a7dc847c8cbd" }, "downloads": -1, "filename": "apistar_cors_hooks-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a244e1a34f4d1eacd54b418008a145dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 3626, "upload_time": "2018-04-21T01:27:55", "url": "https://files.pythonhosted.org/packages/3c/99/8c89672b2338c04f685545f95712a304f54c7986d387ab676e8c72f04ac8/apistar_cors_hooks-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e63a479eaac6168d1e4315d35e3c14f", "sha256": "7e4cb7d62ed0348993cce9845df08ba39538269ebf5d9e2dc2c551fd20946d6d" }, "downloads": -1, "filename": "apistar_cors_hooks-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8e63a479eaac6168d1e4315d35e3c14f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2591, "upload_time": "2018-04-21T01:27:56", "url": "https://files.pythonhosted.org/packages/07/e2/2ed80657b26ceea89e7215e855df799d30890ecf1ecf18ea5684880d4861/apistar_cors_hooks-0.1.1.tar.gz" } ] }