aaditya commited on
Commit
a6d9c05
·
1 Parent(s): 2c977e8

Add application file

Browse files
Files changed (1) hide show
  1. app.py +10 -14
app.py CHANGED
@@ -28,24 +28,20 @@ class Data(Resource):
28
  def get(self):
29
  return DATASET_CONSTANT
30
 
31
- api.add_resource(Status, '/')
32
- api.add_resource(Data, '/data')
33
 
 
 
 
 
 
 
 
34
 
35
- @app.route('/get_sample',methods=['POST'])
36
- def _inference():
37
-
38
- try:
39
- info = request.json["data"]
40
- return jsonify({"result" : encoder.encode(info)})
41
 
42
- except Exception as e:
43
- print(e)
44
- return jsonify({"result":"-1"})
45
 
46
- @app.route('/checking',methods=['GET'])
47
- def check():
48
- return jsonify({"status": 'working'})
49
 
50
  if __name__ == '__main__':
51
  app.run(debug=True)
 
28
  def get(self):
29
  return DATASET_CONSTANT
30
 
 
 
31
 
32
+ class Datas(Resource):
33
+ def post(self):
34
+ parser.add_argument('dataset_name', type=str, required=True)
35
+ args = parser.parse_args()
36
+ dataset_name = args['dataset_name']
37
+ DATASET_CONSTANT['data'].append(dataset_name)
38
+ return {'status': 'Dataset added successfully'}
39
 
40
+ api.add_resource(Status, '/')
41
+ api.add_resource(Data, '/data')
42
+ api.add_resource(Datas, '/data')
 
 
 
43
 
 
 
 
44
 
 
 
 
45
 
46
  if __name__ == '__main__':
47
  app.run(debug=True)