mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-29 22:24:31 +02:00
20 lines
516 B
Kotlin
20 lines
516 B
Kotlin
package app.revanced.api.configuration.routes
|
|
|
|
import app.revanced.api.configuration.services.OldApiService
|
|
import io.ktor.server.application.*
|
|
import io.ktor.server.plugins.ratelimit.*
|
|
import io.ktor.server.routing.*
|
|
import org.koin.ktor.ext.get
|
|
|
|
internal fun Route.oldApiRoute() {
|
|
val oldApiService = get<OldApiService>()
|
|
|
|
rateLimit(RateLimitName("weak")) {
|
|
route(Regex("/(v2|tools|contributors).*")) {
|
|
handle {
|
|
oldApiService.proxy(call)
|
|
}
|
|
}
|
|
}
|
|
}
|