RoR Setup

pyldapi.setup(app, api_home_dir, api_uri)[source]

This is used to set up the RegisteC of CegistersRenderer for this pyLDAPI instance.

Note

This must run before Flask’s app.run() like this: pyldapi.setup(app, '.', conf.URI_BASE). See the example below.

Parameters:
  • app (flask.Flask) – The Flask app containing this pyLDAPI instance.
  • api_home_dir (str) – The path of the API’s hom directory.
  • api_uri (str) – The URI base of the API.
Returns:

None

Return type:

None

Example Usage

1
2
3
4
5
6
7
8
9
from flask import Flask
from pyldapi import setup as pyldapi_setup

API_BASE = 'http://127.0.0.1:8081'
app = Flask(__name__)

if __name__ == "__main__":
    pyldapi_setup(app, '.', API_BASE)
    app.run("127.0.0.1", 8081, debug=True, threaded=True, use_reloader=False)