3vivekb / mtlfs_flask_server

The flask API for mtlfs.vta.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mtlfs_flask_server

This is a simple flask server meant to be an API for the VTA mtlfs in the proper schema.

Raw data is currently being received with the Express Lanes Api Receiver which writes the data to disk and triggers an update to the data served by the flask server.

The Flask server uses a combination of the dynamic data from the receiver and the static descriptive json data in our mtlfs repo to produce output for the api.

See an example with the discovery json or get the dynamic data directly at the toll status json.

How to Run in Dev:

  1. Get the mtlfs in a directory alongside this repo
  2. Clone this repo.
  3. Install the necessary packages(pip install flask) to your Python 3 environment.
  4. Add environment variable export FLASK_APP=server.py
  5. Turn on debug mode export FLASK_DEBUG=1
  6. Run server flask run
  7. View at 127.0.0.1:5000

Production Mode Details:

  1. This guide to get started
  2. Use nginx
  3. Use gunicorn to run gunicorn --bind 0.0.0.0:8000 server:app
  4. Run the express lanes api with node.
  5. Serve up both gunicorn and the node server with supervisorctl

About

The flask API for mtlfs.vta.org


Languages

Language:HTML 72.4%Language:Python 27.6%