https://kotlinlang.org logo
Join SlackCommunities
Powered by
# javalin
  • t

    tipsy

    01/29/2021, 5:35 PM
    yeah, it works fine, you can check out the https://github.com/tipsy/javalinstagram example which does it
  • a

    asad.awadia

    01/29/2021, 5:35 PM
    is it possible to restrict access to it?
  • t

    tipsy

    01/29/2021, 5:35 PM
    using
    before
    filters, yes
  • a

    asad.awadia

    01/29/2021, 5:35 PM
    perf
  • a

    asad.awadia

    01/29/2021, 5:35 PM
    thanks!
  • t

    tipsy

    01/29/2021, 5:35 PM
    you're very welcome
  • a

    asad.awadia

    01/31/2021, 10:46 PM
    @tipsy https://gitlab.com/-/snippets/2068598 thoughts?
    t
    • 2
    • 8
  • t

    tipsy

    02/18/2021, 2:23 PM
    development on javalin 4 has started - track progress and make feature requests here: https://github.com/tipsy/javalin/issues/1172
    👍 2
    d
    • 2
    • 1
  • l

    LeoColman

    03/28/2021, 6:49 PM
    Hi! I need some help with Javalin + OpenAPI.
  • l

    LeoColman

    03/28/2021, 6:49 PM
    I think my endpoints are not being registered correctly.
  • l

    LeoColman

    03/28/2021, 6:50 PM
    I get warnings such as
    A default response was added to the documentation of GET /privacy
    . Although my class is setup with OpenAPI annotations
  • l

    LeoColman

    03/28/2021, 6:50 PM
    Copy code
    class PrivacyController {
        private val privacyHtml = PrivacyController::class.java.classLoader.getResource("privacy.html")!!.readText()
    
        @OpenApi(
            summary = "Privacy Policy",
            description = "Jopiter App privacy policy",
            tags = ["privacy"],
            responses = [
                OpenApiResponse(status = "200", description = "Returns the privacy policy file")
            ]
        )
        fun get(context: Context) {
            context.html(privacyHtml)
        }
    }
  • l

    LeoColman

    03/28/2021, 6:50 PM
    Copy code
    fun register(app: Javalin) {
        app.routes {
            path("/privacy") {
                get(privacyController::get)
            }
        }
    }
  • l

    LeoColman

    03/28/2021, 6:51 PM
    It seems to me that it's glitching on that
    Handler
    . It assumes as a Kotlin Anonymous Lambda, and not the real object, and thus the anonymous lambda doesn't contain any information about the open api
  • l

    LeoColman

    03/28/2021, 7:12 PM
    It seems that Kotlin new IR backend is making this behave badly
  • l

    LeoColman

    03/28/2021, 7:13 PM
    Removing
    IR = true
    works
  • a

    asad.awadia

    05/07/2021, 4:21 PM
    @tipsy i am reading the openapi stuff for Javalin - how do auth headers (like an api key) work in the generated client?
  • t

    tipsy

    08/19/2021, 9:51 AM
    set the channel topic: We use Discord: https://discord.com/invite/sgak4e5NKv
    ❤️ 1
  • a

    asad.awadia

    09/08/2021, 3:35 PM
    @tipsy is it possible to do a seekable stream but prevent downloading?
  • t

    tipsy

    09/08/2021, 3:50 PM
    i'm not sure how that would work
    👍 1
  • d

    Dieter Konrad

    09/15/2021, 2:56 PM
    https://javalin.io/news/javalin-4.0.0-stable.html
    👍 2
    🎉 1
  • a

    asad.awadia

    09/15/2021, 3:10 PM
    Just needs the ability to host multiple hostnames in a single app
  • a

    asad.awadia

    09/15/2021, 3:10 PM
    After that it is basically feature complete
  • r

    Robert Jaros

    10/21/2021, 7:25 AM
    What happened to the releases page https://github.com/tipsy/javalin/releases ?
  • b

    bbaldino

    10/25/2021, 8:32 PM
    I suspect this is a dumb question, but I can’t seem to find the answer in the docs. If I have a group of routes, how can I nest those routes under a common path? I was thinking it would be:
    Copy code
    path("top/level/path") {
        routes {
            get("/hello") { ... }
            post("/world") { ... }
        }
    }
    where I want to access
    /hello
    via
    /top/level/path/hello
    , but this doesn’t seem to be working. Am I missing something?
  • a

    asad.awadia

    10/29/2021, 12:48 AM
    @bbaldino I think you need something like https://github.com/Rudge/kotlin-javalin-realworld-example-app/blob/master/src/main/kotlin/io/realworld/app/web/Router.kt#L37 maybe remove the routes directive
  • d

    Dan

    02/14/2022, 3:43 PM
    Hey Javalin friends! We're still using Javalin over here at Bound! Feel free to apply if you're interested, we're always hiring! https://kotlinlang.slack.com/archives/C0BQ5GZ0S/p1644853212121759
  • j

    james

    03/02/2022, 4:56 AM
    Does anyone have any recommendations/examples for implementing rate-limiting in a Javalin server?e
  • t

    tipsy

    03/08/2022, 6:40 PM
    @james there is a super simple rate limiter included in javalin, but you should probably use something like https://github.com/vladimir-bukhtoyarov/bucket4j
  • t

    tipsy

    03/08/2022, 6:41 PM
    in the future i recommend asking questions on the discord server, very few people use the kotlin slack 🙂
    👍 1