promotion/up_oss.py
2019-07-16 11:30:53 +08:00

24 lines
561 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
# 文件上传接口现网将部署到ops-manager服务器
from __future__ import absolute_import
# pip install flask-restful
from flask import Flask, jsonify
from flask_restful import reqparse, abort, Api, Resource
from log.mylog import define_logger
import logging
from oss_api import Cos_sdk
define_logger("/data/logs/uplog.log")
log = logging.getLogger(__name__)
app = Flask(__name__)
api = Api(app)
# 设置路由
api.add_resource(Cos_sdk, '/cos')
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True, port=9999)