mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-29 22:24:31 +02:00
feat: Use Jetty instead of Netty
This commit is contained in:
parent
ef927688a3
commit
c23cd5cdad
@ -17,6 +17,11 @@ tasks {
|
|||||||
group = "publishing"
|
group = "publishing"
|
||||||
dependsOn(startShadowScripts)
|
dependsOn(startShadowScripts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
// Needed for Jetty to work.
|
||||||
|
mergeServiceFiles()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
@ -57,7 +62,7 @@ dependencies {
|
|||||||
implementation(libs.ktor.server.cors)
|
implementation(libs.ktor.server.cors)
|
||||||
implementation(libs.ktor.server.caching.headers)
|
implementation(libs.ktor.server.caching.headers)
|
||||||
implementation(libs.ktor.server.host.common)
|
implementation(libs.ktor.server.host.common)
|
||||||
implementation(libs.ktor.server.netty)
|
implementation(libs.ktor.server.jetty)
|
||||||
implementation(libs.ktor.server.conditional.headers)
|
implementation(libs.ktor.server.conditional.headers)
|
||||||
implementation(libs.ktor.serialization.kotlinx.json)
|
implementation(libs.ktor.serialization.kotlinx.json)
|
||||||
implementation(libs.koin.ktor)
|
implementation(libs.koin.ktor)
|
||||||
|
@ -28,7 +28,7 @@ ktor-server-auth-jwt = { module = "io.ktor:ktor-server-auth-jwt" }
|
|||||||
ktor-server-cors = { module = "io.ktor:ktor-server-cors" }
|
ktor-server-cors = { module = "io.ktor:ktor-server-cors" }
|
||||||
ktor-server-caching-headers = { module = "io.ktor:ktor-server-caching-headers" }
|
ktor-server-caching-headers = { module = "io.ktor:ktor-server-caching-headers" }
|
||||||
ktor-server-host-common = { module = "io.ktor:ktor-server-host-common" }
|
ktor-server-host-common = { module = "io.ktor:ktor-server-host-common" }
|
||||||
ktor-server-netty = { module = "io.ktor:ktor-server-netty" }
|
ktor-server-jetty = { module = "io.ktor:ktor-server-jetty" }
|
||||||
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json" }
|
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json" }
|
||||||
koin-ktor = { module = "io.insert-koin:koin-ktor", version.ref = "koin" }
|
koin-ktor = { module = "io.insert-koin:koin-ktor", version.ref = "koin" }
|
||||||
h2 = { module = "com.h2database:h2", version.ref = "h2" }
|
h2 = { module = "com.h2database:h2", version.ref = "h2" }
|
||||||
|
@ -6,7 +6,7 @@ import app.revanced.api.configuration.configureSecurity
|
|||||||
import app.revanced.api.configuration.configureSerialization
|
import app.revanced.api.configuration.configureSerialization
|
||||||
import app.revanced.api.configuration.routing.configureRouting
|
import app.revanced.api.configuration.routing.configureRouting
|
||||||
import io.ktor.server.engine.*
|
import io.ktor.server.engine.*
|
||||||
import io.ktor.server.netty.*
|
import io.ktor.server.jetty.*
|
||||||
import picocli.CommandLine
|
import picocli.CommandLine
|
||||||
|
|
||||||
@CommandLine.Command(
|
@CommandLine.Command(
|
||||||
@ -29,7 +29,7 @@ internal object StartAPICommand : Runnable {
|
|||||||
private var port: Int = 8080
|
private var port: Int = 8080
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
embeddedServer(Netty, port, host) {
|
embeddedServer(Jetty, port, host) {
|
||||||
configureDependencies()
|
configureDependencies()
|
||||||
configureHTTP(allowedHost = host)
|
configureHTTP(allowedHost = host)
|
||||||
configureSerialization()
|
configureSerialization()
|
||||||
|
@ -8,5 +8,4 @@
|
|||||||
<appender-ref ref="STDOUT"/>
|
<appender-ref ref="STDOUT"/>
|
||||||
</root>
|
</root>
|
||||||
<logger name="org.eclipse.jetty" level="INFO"/>
|
<logger name="org.eclipse.jetty" level="INFO"/>
|
||||||
<logger name="io.netty" level="INFO"/>
|
</configuration>
|
||||||
</configuration>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user