Skip to content

How to use cors with salvo? #220

Closed Answered by Totodore
Mrmalu asked this question in Q&A
Dec 28, 2023 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

An example has been added to the salvo-echo example with PR #221 :

// This code is used to integrates other tower layers before or after Socket.IO such as CORS
// Beware that classic salvo request won't pass through these layers
let layer = ServiceBuilder::new()
    .layer(CorsLayer::permissive()) // Enable CORS policy
    .layer(layer); // Mount Socket.IO

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@Mrmalu
Comment options

@tausifcreates
Comment options

@Mrmalu
Comment options

@tausifcreates
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Totodore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants