prev chunk
Browse files- client/src/main.py +2 -0
client/src/main.py
CHANGED
|
@@ -17,6 +17,7 @@ import pickle
|
|
| 17 |
import speech_recognition as sr
|
| 18 |
|
| 19 |
from audio_utils import get_microphone, get_speech_recognizer, get_all_audio_queue, to_audio_array, AudioChunk
|
|
|
|
| 20 |
|
| 21 |
logger = logging.getLogger(__name__)
|
| 22 |
|
|
@@ -124,6 +125,7 @@ routes = [
|
|
| 124 |
]
|
| 125 |
|
| 126 |
app = Starlette(debug=True, routes=routes)
|
|
|
|
| 127 |
|
| 128 |
|
| 129 |
def server():
|
|
|
|
| 17 |
import speech_recognition as sr
|
| 18 |
|
| 19 |
from audio_utils import get_microphone, get_speech_recognizer, get_all_audio_queue, to_audio_array, AudioChunk
|
| 20 |
+
from starlette.middleware.cors import CORSMiddleware
|
| 21 |
|
| 22 |
logger = logging.getLogger(__name__)
|
| 23 |
|
|
|
|
| 125 |
]
|
| 126 |
|
| 127 |
app = Starlette(debug=True, routes=routes)
|
| 128 |
+
app.add_middleware(CORSMiddleware, allow_origins=['*'], allow_methods=['*'], allow_headers=['*'])
|
| 129 |
|
| 130 |
|
| 131 |
def server():
|