Example #1
0
from api import application

if __name__ == "__main__":
    application.run(debug=False)
Example #2
0
from api import application

if __name__ == "__main__":
    application.run()

Example #3
0
import ssl
import sys

from api import application

if __name__ == "__main__":

    if sys.argv[1] == 'dev':
        context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
        context.load_cert_chain(
            '/etc/letsencrypt/live/api.thewatcher.io/fullchain.pem',
            '/etc/letsencrypt/live/api.thewatcher.io/privkey.pem',
        )
        application.run(port=8013,
                        host="0.0.0.0",
                        debug=True,
                        ssl_context=context)
        sys.exit()

    application.run()
Example #4
0
from api import application, api
from pages import static_pages
from api.dev.views import dev_ns
from api.supervisor_ayi.views import supervisor_ayi_ns
from api.garbage_classifier.service import load_model

api.add_namespace(dev_ns, "/api/v1/dev")
api.add_namespace(supervisor_ayi_ns, "/api/v1/ayi")

application.register_blueprint(static_pages)

api.init_app(application)

load_model()

if __name__ == "__main__":
    application.run(host="0.0.0.0",
                    port=40086,
                    threaded=True,
                    debug=application.config['DEBUG'])
Example #5
0
from api import application
import os
PORT = os.environ.get('PORT')
ENVIRONMENT = os.environ.get('ENVIRONMENT')

if __name__ == '__main__':
    application.run(host='0.0.0.0',
                    port=PORT if PORT else 5000,
                    debug=(ENVIRONMENT != 'production'))
Example #6
0
# app_docker.py

# - for docker we want to bind to all network interfaces
#

from api import application

if __name__ == '__main__':
    application.run(debug=False, host='0.0.0.0')
Example #7
0
    return Response(json.dumps({'info': 'INTERNAL SERVER info (CHECK LOGS)'}),
                    status=500,
                    mimetype='application/json')


class Index(Resource):
    def get(self):
        return jsonify({"message": "working"})


api = Api(application)
api.add_resource(Index, "/", endpoint="index")
api.add_resource(Descriptor, "/descriptor")
api.add_resource(Lifecycle, "/lifecycle/installed")
api.add_resource(Webhooks,
                 "/webhooks/<string:webhook_type>",
                 endpoint="webhooks")
api.add_resource(Webhooks,
                 "/webhooks/message/<string:thanks>",
                 endpoint="thanks")


@application.route('/dialog')
def dialog():
    return render_template("dialog.html")


if __name__ == "__main__":
    port = int(os.environ.get('PORT', 5000))
    application.run(host='0.0.0.0', port=port)
Example #8
0
from api import application

if __name__ == "__main__":
    application.run(host='0.0.0.0', port=10001)
Example #9
0
from api import application
"""
WSGI entrypoint for the application
"""
if __name__ == '__main__':
    application.run(debug=True)