This web application handles Inria MOOC Accessibility web player events. Its main purpose is to act as a gateway between the web client and an ElasticSearch server.
pipenv installFor development purpose, you also should install additional packages:
pipenv install --devThe application assumes ElasticSearch is used to save records. If no
ElasticSearch server can be found, it will just output errors and return 500
errors.
Most straightforward installation requires Docker. Just cd into the
application directory and run docker-compose up.
Running this command will start an ElasticSearch server on
http://localhost:9200 and a Kibana instance on http://localhost:5601 to
visualize events.
pipenv run lint # runs pycodestyle
pipenv run lint_fix # fixes malformed codecd /path/to/mooc-accessibility-api
pipenv run serve_devApplication will be served through built-in Flask server on port 3001.
Gunicorn is provided as a dependency, and should be the prefered way to serve the application in production.
# numbers of workers depend on the machine hosting the application
pipenv run gunicorn --workers=3 --bind=127.0.0.1:8000 wsgi:applicationLogs are written to STDERR and STDOUT. This can be overridden by configuring
the wsgi app container.
The .env file hosts a few variables you may need to change before running the
application.