We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4ab312 commit 605574fCopy full SHA for 605574f
src/main/kotlin/Application.kt
@@ -5,6 +5,7 @@ import io.ktor.server.application.*
5
import io.ktor.server.plugins.*
6
import io.ktor.server.plugins.statuspages.*
7
import io.ktor.server.response.*
8
+import io.ktor.server.plugins.cors.routing.*
9
10
fun main(args: Array<String>) {
11
io.ktor.server.netty.EngineMain.main(args)
@@ -21,5 +22,15 @@ fun Application.module() {
21
22
}
23
24
25
+ install(CORS) {
26
+ anyHost()
27
+ allowHeader(HttpHeaders.ContentType)
28
+ allowHeader(HttpHeaders.Authorization)
29
+ allowMethod(HttpMethod.Get)
30
+ allowMethod(HttpMethod.Post)
31
+ allowMethod(HttpMethod.Put)
32
+ allowMethod(HttpMethod.Delete)
33
+ }
34
+
35
configureRouting()
36
0 commit comments