mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-01-18 08:53:57 +00:00
fix: Move old API endpoint configuration from env to configuration file
This commit is contained in:
@@ -123,10 +123,11 @@ fun Application.configureDependencies(
|
||||
AuthService(issuer, validityInMin, jwtSecret, authSHA256DigestString)
|
||||
}
|
||||
single {
|
||||
val configuration = get<ConfigurationRepository>()
|
||||
|
||||
OldApiService(
|
||||
get {
|
||||
val defaultRequestUri = get<Dotenv>()["OLD_API_URL"]
|
||||
parameterArrayOf(defaultRequestUri)
|
||||
parameterArrayOf(configuration.oldApiEndpoint)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.io.File
|
||||
* @property apiVersion The version to use for the API.
|
||||
* @property corsAllowedHosts The hosts allowed to make requests to the API.
|
||||
* @property endpoint The endpoint of the API.
|
||||
* @property oldApiEndpoint The endpoint of the old API to proxy requests to.
|
||||
*/
|
||||
@Serializable
|
||||
internal class ConfigurationRepository(
|
||||
@@ -34,6 +35,8 @@ internal class ConfigurationRepository(
|
||||
@SerialName("cors-allowed-hosts")
|
||||
val corsAllowedHosts: Set<String>,
|
||||
val endpoint: String,
|
||||
@SerialName("old-api-endpoint")
|
||||
val oldApiEndpoint: String,
|
||||
) {
|
||||
/**
|
||||
* An asset configuration.
|
||||
|
||||
Reference in New Issue
Block a user