Skip to content

Commit 390dec2

Browse files
committed
add comments
1 parent 74dbb61 commit 390dec2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ And the raw executable here:
148148

149149
- `<project-dir>\src-tauri\target\release`
150150

151+
## Issue's ?
152+
153+
- "Failed to fetch" error: In `src/backends/main.py` CORS expects your UI is running on localhost:3000. If not, add your url to the `origins = []` array or set:
154+
155+
```python
156+
app.add_middleware(
157+
allow_origins="*" # whitelist everything
158+
)
159+
```
160+
151161
## Todo's
152162

153163
- Pass parameters to the sidecar (like server port) via a frontend form.

src/backends/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
# Configure CORS settings
2222
origins = [
2323
"http://localhost:3000",
24-
# "https://your-web-app.com",
24+
# "https://your-web-ui.com",
2525
]
2626
app.add_middleware(
2727
CORSMiddleware,
28-
allow_origins=origins,
28+
allow_origins=origins, # or use "*" to whitelist any url
2929
# allow_credentials=True,
3030
allow_methods=["*"],
3131
allow_headers=["*"],

0 commit comments

Comments
 (0)