diff --git a/configuration.example.toml b/configuration.example.toml index 9e4ac10..71f983b 100644 --- a/configuration.example.toml +++ b/configuration.example.toml @@ -1,4 +1,4 @@ -api-version = 1 +api-version = "v1" cors-allowed-hosts = [ "revanced.app", "*.revanced.app" diff --git a/src/main/kotlin/app/revanced/api/configuration/Routing.kt b/src/main/kotlin/app/revanced/api/configuration/Routing.kt index 2ed8106..da1af7c 100644 --- a/src/main/kotlin/app/revanced/api/configuration/Routing.kt +++ b/src/main/kotlin/app/revanced/api/configuration/Routing.kt @@ -18,7 +18,7 @@ internal fun Application.configureRouting() = routing { installCache(5.minutes) - route("/v${configuration.apiVersion}") { + route("/${configuration.apiVersion}") { announcementsRoute() patchesRoute() managerRoute() diff --git a/src/main/kotlin/app/revanced/api/configuration/repository/ConfigurationRepository.kt b/src/main/kotlin/app/revanced/api/configuration/repository/ConfigurationRepository.kt index 81f8a76..4c46887 100644 --- a/src/main/kotlin/app/revanced/api/configuration/repository/ConfigurationRepository.kt +++ b/src/main/kotlin/app/revanced/api/configuration/repository/ConfigurationRepository.kt @@ -45,7 +45,7 @@ internal class ConfigurationRepository( @SerialName("backend-service-name") val backendServiceName: String, @SerialName("api-version") - val apiVersion: Int = 1, + val apiVersion: String = "v1", @SerialName("cors-allowed-hosts") val corsAllowedHosts: Set, val endpoint: String, diff --git a/src/main/kotlin/app/revanced/api/configuration/routes/ApiRoute.kt b/src/main/kotlin/app/revanced/api/configuration/routes/ApiRoute.kt index 423c3e6..f5311b1 100644 --- a/src/main/kotlin/app/revanced/api/configuration/routes/ApiRoute.kt +++ b/src/main/kotlin/app/revanced/api/configuration/routes/ApiRoute.kt @@ -183,7 +183,7 @@ private fun Route.installTokenRouteDocumentation() = installNotarizedRoute { "username=\"ReVanced\", " + "realm=\"ReVanced\", " + "nonce=\"abc123\", " + - "uri=\"/v${configuration.apiVersion}/token\", " + + "uri=\"/${configuration.apiVersion}/token\", " + "algorithm=SHA-256, " + "response=\"yxz456\"", ),