Skip to content

Commit

Permalink
feat: Allow versioning by arbitrary path string
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Nov 6, 2024
1 parent eca40a6 commit 814d3c9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configuration.example.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api-version = 1
api-version = "v1"
cors-allowed-hosts = [
"revanced.app",
"*.revanced.app"
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/api/configuration/Routing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal fun Application.configureRouting() = routing {

installCache(5.minutes)

route("/v${configuration.apiVersion}") {
route("/${configuration.apiVersion}") {
announcementsRoute()
patchesRoute()
managerRoute()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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\"",
),
Expand Down

0 comments on commit 814d3c9

Please sign in to comment.