2020-03-15 19:02:37 +00:00
|
|
|
from flask import Flask, request, g, render_template
|
|
|
|
|
from flask_restful import Resource, reqparse
|
|
|
|
|
from flask_restful_swagger_3 import Api
|
|
|
|
|
from flask_cors import CORS
|
|
|
|
|
import os
|
|
|
|
|
from json import dumps
|
|
|
|
|
import application.endpoints as endpoints
|
|
|
|
|
import application.config as config
|
|
|
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
api = Api(app, version='1', contact={"name":""}, license={"name":"Online Dienst Dokumentation"}, api_spec_url='/api/swagger')
|
|
|
|
|
|
|
|
|
|
|
2020-03-19 16:52:30 +00:00
|
|
|
|
2020-03-15 23:31:07 +00:00
|
|
|
api.add_resource(endpoints.PersonList,'/api/v1/person/<string:id>', '/api/v1/person/')
|
2020-03-19 16:52:30 +00:00
|
|
|
api.add_resource(endpoints.Camera,'/api/v1/camera/<string:type>', "/api/v1/camera/")
|
2020-03-15 19:02:37 +00:00
|
|
|
|
|
|
|
|
@app.route("/")
|
|
|
|
|
def index():
|
|
|
|
|
"""serve the ui"""
|
|
|
|
|
return render_template("index.html")
|
|
|
|
|
|