1
0
Fork 0
A REST-API built with Flask and Python. Its main purpose is to receive the readings from the light meters welding booths in the Ritherdon factory and make them available for consumption by the relay-controllers in the gallery.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

24 lines
733 B

import os
import connexion
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
basedir = os.path.abspath(os.path.dirname(__file__))
# Creates the Connexion application instance
connex_app = connexion.App(__name__, specification_dir=basedir)
# Gets the underlying Flask app instance
app = connex_app.app
database_uri = "sqlite:////" + os.path.join(basedir, "readings.db")
# Configures the SQLAlchemy part of the app instance
app.config["SQLALCHEMY_ECHO"] = True # Set to false in prod.
app.config["SQLALCHEMY_DATABASE_URI"] = database_uri
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
# Creates the SQLAlchemy db instance
db = SQLAlchemy(app)
# Initialises Marshmallow
ma = Marshmallow(app)