AliHamza123 commited on
Commit
06b72e8
·
1 Parent(s): 813b4bd
Files changed (4) hide show
  1. Procfile +1 -0
  2. app.py +19 -0
  3. requirements.txt +2 -0
  4. setup.sh +3 -0
Procfile ADDED
@@ -0,0 +1 @@
 
 
1
+ web: gunicorn app:app
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, request, jsonify
2
+
3
+ app = Flask(__name__)
4
+
5
+ @app.route('/upload', methods=['POST'])
6
+ def upload_file():
7
+ if 'file' not in request.files:
8
+ return jsonify({'error': 'No file part'}), 400
9
+ file = request.files['file']
10
+ if file.filename == '':
11
+ return jsonify({'error': 'No selected file'}), 400
12
+ if file:
13
+ # Process the file here (e.g., read its content, save it, etc.)
14
+ content = file.read().decode('utf-8')
15
+ # For example, let's just return the content as a response
16
+ return jsonify({'content': content})
17
+
18
+ if __name__ == '__main__':
19
+ app.run(debug=True)
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Flask
2
+ gunicorn
setup.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ pip install -r requirements.txt