mainController.py 713 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. @author: dagarcos
  5. """
  6. import os
  7. from flask import render_template, Blueprint, url_for, redirect, request, jsonify
  8. from flask_cors import CORS, cross_origin
  9. from services.testService import TestService
  10. mainController = Blueprint('mainController', __name__)
  11. CORS(mainController, origins = '*', allow_headers=['Content-Type', 'content-type', 'Authorization', 'Access-Control-Allow-Credentials', 'Access-Control-Allow-Headers'], supports_credentials=True)
  12. tserv = TestService()
  13. @mainController.route('/test', methods=['GET'])
  14. def getDatos():
  15. return jsonify(tserv.get_all())
  16. @mainController.route('/status', methods=['GET'])
  17. def getStatus():
  18. return "OK"