#I can't host ktor server

1 messages · Page 1 of 1 (latest)

cold pilot
#

I get an error
I'm encountering an issue when trying to build my project with the following command:
java -Xmx512m -jar build/libs/com.ilya.ktor-meetmap-all.jar

The error message I receive is:
Exception in thread "main" java.lang.IllegalArgumentException: Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf

Even when I try to specify the sslPort directly with the following command:
java -Xmx512m -jar build/libs/com.ilya.ktor-meetmap-all.jar -sslPort 8080

pale pecanBOT
#

Project ID: N/A

crisp dust
#

do not specify anything relating to SSL as railway handles that for you.
you need to listen on the $PORT environment variable

crisp dust
cold pilot
#

I have already recorded this change in both the main file and configuration.conf

#

fun main() {
val port = System.getenv("PORT")?.toInt() ?: 8080
embeddedServer(Netty, host = "0.0.0.0", port = port, module = Application::module).start(wait = true)
}

#

@crisp dust And it doesn't help

crisp dust
#

I don't have much experience with java so the best advice I could give would be to tell you to do some research on this error because it would not be platform specific

cold pilot
#

I meant thanks for the advice

fallen eagle
#

ay. i do ktor exclusively on railway. lemme see if i can see whats up

fallen eagle
#

weird.

#

let me go through my own tutorial again to see if something is now out of date

#

following my tutorial everything works. sounds like something in your config is wrong

#

if you have a sample repo that causes the issue id be more than happy to check it out

cold pilot
#

I've done everything.

#

Server is

#

Working

crisp dust
#

success?

fallen eagle
crisp dust
#

good enough for me

remote ferryBOT
fallen eagle
#

TIL about answer overflow!