-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix interface of run_api for running REST API
The current `run_api` interface for running the AiiDA REST API had unnecessarily many parameters, making it complicated to use in WSGI scripts, e.g.: ```python from aiida.restapi import api from aiida.restapi.run_api import run_api import aiida.restapi CONFIG_DIR = os.path.join(os.path.split( os.path.abspath(aiida.restapi.__file__))[0], 'common') (app, api) = run_api( api.App, api.AiidaApi, hostname="localhost", port=5000, config=CONFIG_DIR, debug=False, wsgi_profile=False, hookup=False, catch_internal_server=False ) ``` While all but the first two parameters are keyword arguments, the code would actually crash if they are not provided. In reality, there is no reason to have to specify *any* parameters whatsoever and one should simply be able to call `run_api()`. This commit accomplishes this by defining the appropriate default values.
- Loading branch information
Showing
5 changed files
with
90 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters