Commit 0ad79d03 authored by W.D.R.P. Sandeepa's avatar W.D.R.P. Sandeepa

Merge branch 'it18218640' into 'master'

add client.js file

See merge request !112
parents f682946d 2c901044
import requests 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" TEST_AUDIO_FILE_PATH = "test/red.wav"
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -9,6 +9,9 @@ app = Flask(__name__) ...@@ -9,6 +9,9 @@ app = Flask(__name__)
def predict(): def predict():
# get audio file and save it # get audio file and save it
audio_file = request.files["file"] audio_file = request.files["file"]
# print(f"{request.files['file']}")
# print(f"{request.files['name']}")
file_name = str(random.randint(0, 100000)) file_name = str(random.randint(0, 100000))
audio_file.save((file_name)) audio_file.save((file_name))
...@@ -34,6 +37,6 @@ def predict(): ...@@ -34,6 +37,6 @@ def predict():
return jsonify(data) return jsonify(data)
if __name__ == "__main__": 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(host='192.168.8.100,port='5000', debug=True)
app.run(debug=False) # app.run(debug=False)
\ No newline at end of file \ 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