Hello everyone, everything good? I'm using ktor a...
# server
j
Hello everyone, everything good? I'm using ktor and I want to use
"'Access-Control-Allow-Origin': '*'"
, has anyone done this?
j
you should be able to use
Copy code
install(CORS)
with appropriate config
j
Thanks for the answer, yes I'm doing it
I'm setting it up this way
Copy code
install(CORS) {
        method(HttpMethod.Options)
        method(<http://HttpMethod.Post|HttpMethod.Post>)
        method(HttpMethod.Get)
        method(HttpMethod.Put)
        method(HttpMethod.Delete)
        method(HttpMethod.Head)
        header(HttpHeaders.AccessControlAllowHeaders)
        header(HttpHeaders.ContentType)
        header(HttpHeaders.AccessControlAllowOrigin)
        allowCredentials = true
        allowNonSimpleContentTypes = true
        anyHost()
    }
It worked here @John O'Reilly
Thank you
👍 1