Commit 2c901044 authored by W.D.R.P. Sandeepa's avatar W.D.R.P. Sandeepa

add client.js file

parent f682946d
import requests
URL = "http://127.0.0.1:5000/predict"
URL = "http://192.168.8.101:5000/predict"
TEST_AUDIO_FILE_PATH = "test/red.wav"
if __name__ == "__main__":
......
......@@ -9,6 +9,9 @@ app = Flask(__name__)
def predict():
# get audio file and save it
audio_file = request.files["file"]
# print(f"{request.files['file']}")
# print(f"{request.files['name']}")
file_name = str(random.randint(0, 100000))
audio_file.save((file_name))
......@@ -34,6 +37,6 @@ def predict():
return jsonify(data)
if __name__ == "__main__":
# app.run(host='192.168.8.100')
app.run(host='192.168.8.101')
#app.run(host='192.168.8.100,port='5000', debug=True)
app.run(debug=False)
\ No newline at end of file
# app.run(debug=False)
\ No newline at end of file
import axios from 'axios';
export default axios.create({ baseURL: 'http://192.168.8.101:5000/predict',timeout: 15000, });
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment