from resources import app

if __name__ == '__main__':
    app.run(port=5010)
Exemple #2
0
from flask_restful import Api
from resources import Login, Logout, Person, FNameSearch, Index, app

api = Api(app)
api.add_resource(Index, "/")
api.add_resource(Person, "/api")
api.add_resource(Login, "/login")
api.add_resource(Logout, "/logout")
api.add_resource(FNameSearch, "/search/<string:name>")
api.add_resource(Person, "/api/<string:id>", endpoint="id")
api.add_resource(Person, "/api/<int:maximum>", endpoint="maximum")

if __name__ == "__main__":
    app.run(host='0.0.0.0', debug=True)
Exemple #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from flask import Flask
from resources import app
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--debug', action='store_true')

if __name__ == '__main__':
	app.debug = parser.parse_args().debug
	app.run(host='0.0.0.0', port=5003, threaded=True, use_reloader=True)
Exemple #4
0
# -*- coding: utf-8 -*-
# !/usr/bin/env python
from resources import app

if __name__ == '__main__':
    app.run(debug=True,port=7000)
def execute(debug):
    app.run(host="0.0.0.0", port=PORT, debug=debug)
from resources import api, app
from resources.Authentication import Authentication
from resources.QuizResource import QuizResource
from resources.UserServices import UserServices
from resources.ContactsResource import ContactsServices
from resources.PublicationServices import PublicationServices
from resources.ParticipationServices import ParticipationServices




api.add_resource(Authentication, '/authenticate/', endpoint='authenticate')
api.add_resource(UserServices, '/users/', '/users/<login>', endpoint='user')
api.add_resource(QuizResource, "/quiz/", "/quiz/<quiz_id>", "/quiz/<quiz_id>/<question_id>", endpoint="quiz")
api.add_resource(ContactsServices, "/contacts/", "/contacts/<group_name>", "/contacts/<group_name>/id/<contact_id>", endpoint="contact")
api.add_resource(PublicationServices,  "/publication/<quiz_id>/", "/publication/<quiz_id>/<contact_group>/", endpoint="publication")
api.add_resource(ParticipationServices,  "/participation/<pub_hash>/", endpoint="participation")


if __name__ == '__main__':
    app.run(host="0.0.0.0", port=8080, debug=True)
Exemple #7
0
import os
from resources import app
from resources.rest import init_db

APP_SECRET_KEY = \
    'YOUR KEY HERE'

if __name__ == '__main__':
    app.secret_key = APP_SECRET_KEY
    if not os.path.exists(app.config.get('DATABASE')):
        init_db()
    app.run(host=app.config.get('IP'),
            port=app.config.get('PORT'),
            use_debugger=False,
            debug=True,
            use_reloader=False)
from resources import app
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--debug', action='store_true')

if __name__ == '__main__':
    app.debug = parser.parse_args().debug
    app.run()
Exemple #9
0
from resources import app, host_val

if __name__ == "__main__":
    app.run(host_val, port=5000, debug=True)
Exemple #10
0
from resources import app

if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0', port=9100)
Exemple #11
0
from modules.analyzes.part.parttype import routers
from modules.analyzes.machineEngine.capacity import routers
from modules.analyzes.machineEngine.enginespeed import routers
from modules.analyzes.machineEngine.enginetype import routers
from modules.analyzes.machineEngine.roomtype import routers
from modules.analyzes.machineEngine.volume import routers
from modules.analyzes.machineEngine import routers
from modules.analyzes.door.doorsize import routers
from modules.analyzes.door.doortype import routers
from modules.analyzes.door.paneltype import routers
from modules.analyzes.door import routers
from modules.brand import routers
# ======== Rest Endpoints ========
from modules import rest_endpoints
# ======== Admin Route ===========
from admin_route import routers

if isinstance(
        SCHEDULE_CTRL,
        ScheduleController) and SCHEDULE_CTRL.scheduler.running is not True:
    register_daily_schedule()
    app.logger.warning("*** SCHEDULE_CTRL.run_schedules fired")
    SCHEDULE_CTRL.run_schedules()
    app.logger.warning("*** list of jobs: {}".format(
        str(SCHEDULE_CTRL.scheduler.get_jobs())))

if __name__ == "__main__":
    app.run(host="0.0.0.0",
            port="8080",
            debug=app.config.get('APP_DEBUG', True))
from resources import api, app
from resources.Authentication import Authentication
from resources.QuizResource import QuizResource
from resources.UserServices import UserServices
from resources.ContactsResource import ContactsServices
from resources.PublicationServices import PublicationServices
from resources.ParticipationServices import ParticipationServices

api.add_resource(Authentication, '/authenticate/', endpoint='authenticate')
api.add_resource(UserServices, '/users/', '/users/<login>', endpoint='user')
api.add_resource(QuizResource,
                 "/quiz/",
                 "/quiz/<quiz_id>",
                 "/quiz/<quiz_id>/<question_id>",
                 endpoint="quiz")
api.add_resource(ContactsServices,
                 "/contacts/",
                 "/contacts/<group_name>",
                 "/contacts/<group_name>/id/<contact_id>",
                 endpoint="contact")
api.add_resource(PublicationServices,
                 "/publication/<quiz_id>/",
                 "/publication/<quiz_id>/<contact_group>/",
                 endpoint="publication")
api.add_resource(ParticipationServices,
                 "/participation/<pub_hash>/",
                 endpoint="participation")

if __name__ == '__main__':
    app.run(host="0.0.0.0", port=8080, debug=True)
Exemple #13
0
# !flask/bin/python
"""
Author:      XuLin Yang & Renjie Meng
Student id:  904904 & 877396
Date:        2020-4-24 01:09:38
Description: backend flask application
"""

import argparse
import sys

from resources import app

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('-test',
                        help='test the compilation of the application')
    parser.add_argument('-host', help='host address')
    parser.add_argument('-port', help='host port number')
    args = parser.parse_args()

    if args.test:
        print("Successfully compiled")
        sys.exit(0)

    app.run(debug=True, host=args.host, port=args.port)
Exemple #14
0
from resources import app, celery
from restplus import api
from flask import Flask, Blueprint

blueprint = Blueprint('api', __name__, url_prefix='/api')

api.init_app(blueprint,
             version='0.1',
             title='Pokemon Battle Valdivia',
             description='Pokemon league api')

app.register_blueprint(blueprint)

if __name__ == "__main__":
    app.run(debug=True, port=8010)
Exemple #15
0
from resources import app

if __name__ == '__main__':
    app.run(debug=True)
Exemple #16
0
import os
from resources import app
from resources.rest import init_db

APP_SECRET_KEY = \
    'YOUR KEY HERE'

if __name__ == '__main__':
    app.secret_key = APP_SECRET_KEY
    if not os.path.exists(app.config.get('DATABASE')):
        init_db()
    app.run(host=app.config.get('IP'), port=app.config.get('PORT'), use_debugger=False, debug=True, use_reloader=False)
Exemple #17
0
from resources import app

host = '0.0.0.0'
port = 8081
debug = True

if __name__ == '__main__':
    app.run(host, port, debug)
Exemple #18
0
from resources.userdetail import UserDetail

app = Flask(__name__)
app.debug = True
api = Api(app)

mongo = PyMongo(app)

users = {
	'jean9' : {'firstname': 'Jeannine', 'lastname': 'Tondreau'},
	'nstark': {'firstname': 'Nick', 'lastname': 'Stark'},
}

#Rest Controllers
class ApiDocumentation(Resource):
	def get(self):
		return 'Api documentation'

#Routing
api.add_resource(ApiDocumentation, '/')
api.add_resource(UsersCollection, '/users')
api.add_resource(UserDetail, '/users/<string:username>')

if __name__ == '__main__':
    app.run(host='0.0.0.0')

'''

from resources import app
app.run(host='0.0.0.0')
Exemple #19
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from flask import Flask
from resources import app
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--debug', action='store_true')

if __name__ == '__main__':
    app.debug = parser.parse_args().debug
    app.run(host='0.0.0.0', port=5003, threaded=True, use_reloader=True)