Skip to content
Snippets Groups Projects
Commit 82392d1a authored by Clément CORNU's avatar Clément CORNU
Browse files

feat: allow CORS and remove useless package

parent 8fea5840
Branches
No related tags found
No related merge requests found
......@@ -39,6 +39,7 @@ dependencies {
implementation("io.ktor:ktor-server-config-yaml:$ktor_version")
implementation("io.ktor:ktor-server-netty:$ktor_version")
implementation("io.ktor:ktor-server-status-pages:$ktor_version")
implementation("io.ktor:ktor-server-cors:$ktor_version")
// Dependency injection
implementation("io.insert-koin:koin-ktor:$koin_version")
......@@ -54,7 +55,7 @@ dependencies {
implementation("software.amazon.awssdk:dynamodb:$dynamo_version")
implementation("dev.andrewohara:dynamokt:$dynamo_kt_version")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactive:$kotlin_reactive_version")
implementation("io.ktor:ktor-server-host-common:$ktor_version")
// Tests
testImplementation("io.ktor:ktor-server-test-host")
......
package betclic.test.configuration
import betclic.test.player.routes.playerRoutes
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.plugins.cors.routing.*
import io.ktor.server.routing.*
fun Application.configureRouting() {
install(CORS) {
allowMethod(HttpMethod.Get)
allowMethod(HttpMethod.Options)
allowMethod(HttpMethod.Put)
allowMethod(HttpMethod.Delete)
allowMethod(HttpMethod.Patch)
anyHost()
}
routing {
playerRoutes()
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment