Commit 91522f4
committed
feat: add cargo dependency tower-http
With the new Axum implementation for the API the browser does not make
request to the API becuase of the Cross-Origin Resource Sharing (CORS)
policy. By default there is no header `Access-Control-Allow-Origin` and
it does not allow the request.
You can be permissive by adding a layer to the router:
```
Router::new().nest("/v1", api_routes).layer(CorsLayer::permissive())
```
For the time being you need to change that line manually when you want
to setup a dev env with the banckend and the frontend using different
ports.1 parent 79682a5 commit 91522f4
2 files changed
+26
-0
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
0 commit comments