feat: Allow versioning by arbitrary path string

This commit is contained in:
oSumAtrIX 2024-11-06 04:28:26 +01:00
parent eca40a6979
commit 814d3c946e
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
4 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
api-version = 1
api-version = "v1"
cors-allowed-hosts = [
"revanced.app",
"*.revanced.app"

View File

@ -18,7 +18,7 @@ internal fun Application.configureRouting() = routing {
installCache(5.minutes)
route("/v${configuration.apiVersion}") {
route("/${configuration.apiVersion}") {
announcementsRoute()
patchesRoute()
managerRoute()

View File

@ -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<String>,
val endpoint: String,

View File

@ -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\"",
),