index.py
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from flask import Flask, request
from flask_restplus import Resource, Api, fields
import process
app = Flask(__name__, static_url_path='/static')
api = Api(app, version='1.0', title='FlaskLocal', description='FlaskLocal')
ns_node = api.namespace('node', description='node API')
node_response = ns_node.model("test_response",{
"unknown_person": fields.Boolean,
"fire_broken" : fields.Boolean
})
node_request = ns_node.model('test_request', {
'data': fields.String
})
#앱빌더를 통해 새 게시물 & 댓글 알림 수신
@ns_node.route('/process')
class test(Resource):
@ns_node.doc('post')
@ns_node.expect(node_request)
#@ns_node.marshal_with(node_response)
def post(self):
print(api)
print(api.payload)
#res = node.ProcessImage(api.payload)
#return res
@app.route('/process', methods=['POST'])
def post():
#print(request.form)
res = node.ProcessImage(request.form)
return res
if __name__ == '__main__':
node = process.Process()
app.run(host='0.0.0.0', port=80, threaded=False)