Skip to content

Conversation

@josecelano
Copy link
Member

API migration to Axum for user context.

@josecelano josecelano added the Code Cleanup / Refactoring Tidying and Making Neat label Jun 13, 2023
@josecelano josecelano linked an issue Jun 13, 2023 that may be closed by this pull request
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.
@josecelano josecelano marked this pull request as ready for review June 14, 2023 15:52
@josecelano josecelano merged commit 03dba5c into torrust:develop Jun 14, 2023
@da2ce7
Copy link
Contributor

da2ce7 commented Jun 16, 2023

Looks Good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Cleanup / Refactoring Tidying and Making Neat

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Axum API: user context

2 participants