All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlin-server.libraries.javalin5.Main.kt.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
package {{packageName}}

import io.javalin.Javalin
import io.javalin.community.routing.dsl.routing

{{#apiInfo}}
{{#apis}}
{{#operations}}import {{apiPackage}}.{{classname}}
import {{apiPackage}}.{{classname}}ServiceImpl
{{/operations}}
{{/apis}}

fun main() {
    {{#apis}}
    {{#operations}}
    val {{classname}} = {{classname}}({{classname}}ServiceImpl())
    {{/operations}}
    {{/apis}}

    val app = Javalin
        .create { config ->
            config.routing {
                {{#apis}}
                {{#operations}}
                {{#operation}}
                {{#lowercase}}{{httpMethod}}{{/lowercase}}("{{path}}", {{classname}}::{{operationId}})
                {{/operation}}
                {{/operations}}

                {{/apis}}
            }
        }

    app.start({{serverPort}})
}
{{/apiInfo}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy