Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many arguments for public fun ignite() #34

Closed
matths opened this issue Jul 24, 2018 · 1 comment
Closed

Too many arguments for public fun ignite() #34

matths opened this issue Jul 24, 2018 · 1 comment

Comments

@matths
Copy link

matths commented Jul 24, 2018

Hi!
I try to run the basic example given on the project main page:

val http = ignite {
    port = 8080
    ipAddress = "0.0.0.0"
    threadPool {
        maxThreads = 10
        minThreads = 5
        idleTimeoutMillis = 1000
    }
}

http.get("/") {
    "Hello Spark Kotlin!"
}

but it gives already errors without doing a compile/build step, saying "Too many arguments for public fun ignite()". I would appreciate a working example or some hint, what goes wrong.

I added import spark.kotlin.* to the import section of my main.kt file and implementation "com.sparkjava:spark-kotlin:1.0.0-alpha" to my modules build.gradle dependencies section. And yes I triggered a gradle sync afterwards.

@matths
Copy link
Author

matths commented Jul 24, 2018

Nevermind. I eventually found the documentation on the website and changed syntax into

       val http = ignite()

        http.port(8080)
        http.ipAddress("0.0.0.0")

        val maxThreads = 8
        val minThreads = 2
        val timeOutMillis = 30000
        http.threadPool(maxThreads, minThreads, timeOutMillis)

        http.get("/") {
            "Hello Spark Kotlin!"
        }

Now that it's compiling, I get runtime error saying it needs functionalities from above API 24. AS I need to support API 21 (Android 5.0 Lollipop), I can't use Spark in the project.
Any recommendation what to use for an embedded webserver that is able to do https.

@matths matths closed this as completed Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant