Beispiel #1
0
# coding:utf-8

from app.api import api

# api.run(debug=True)
# from app.service.FileStash import FileStash

# stash = FileStash()
# shutdown_event = threading.Event()
# try:
api.run(debug=True, port=5001)
Beispiel #2
0
        'done': False
    }
    tasks.append(task)
    return jsonify({'task': task}), 201

@api.route('/test', methods=['GET'])
@auth.login_required
def test():
    return jsonify({'code': 'ok'})

@api.route('/api/v1/check', methods=['GET'])
@auth.login_required
def check():
    realip = request.environ['REMOTE_ADDR']
    access_log.info('[check ok ip: %s]'%realip)
    # 分页
    # posts = Jianshu.objects()
    # ret = parse_page_data(posts)
    return jsonify({
        'code': 1,
        'message': 'ok',
        # 'data': ret,
    })
# 404处理
# @app.errorhandler(404)
# def not_found(error):
#     return make_response(jsonify({'error': 'Not Found'}), 404)

if __name__ == '__main__':
    api.run(debug=True)
Beispiel #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from app.api import api as app

app.run(host='0.0.0.0', port=8001, debug=True)
Beispiel #4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from app.api import api as app

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=9000, debug=True)
Beispiel #5
0
from app.api import api

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