package cc.unitmesh.server.plugins import io.ktor.http.* import io.ktor.server.application.* import io.ktor.server.plugins.cors.routing.* fun Application.configureCORS() { install(CORS) { allowMethod(HttpMethod.Options) allowMethod(HttpMethod.Get) allowMethod(HttpMethod.Post) allowMethod(HttpMethod.Put) allowMethod(HttpMethod.Delete) allowMethod(HttpMethod.Patch) allowHeader(HttpHeaders.Authorization) allowHeader(HttpHeaders.ContentType) allowHeader(HttpHeaders.Accept) anyHost() // For MVP, allow all hosts. In production, restrict this! } }