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

kotlin-server.libraries.ktor.api.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
{{>licenseInfo}}
package {{apiPackage}}

import com.google.gson.Gson
import io.ktor.application.*
import io.ktor.auth.*
import io.ktor.http.*
import io.ktor.response.*
{{#featureLocations}}
import {{packageName}}.Paths
import io.ktor.locations.*
{{/featureLocations}}
import io.ktor.routing.*
import {{packageName}}.infrastructure.ApiPrincipal
{{#imports}}import {{import}}
{{/imports}}

{{#operations}}
{{#featureLocations}}
@KtorExperimentalLocationsAPI
{{/featureLocations}}
fun Route.{{classname}}() {
    val gson = Gson()
    val empty = mutableMapOf()

{{#operation}}
    {{#hasAuthMethods}}
        {{#authMethods}}
    authenticate("{{{name}}}") {
        {{/authMethods}}
    {{/hasAuthMethods}}
    {{^featureLocations}}
    route("{{path}}") {
        {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}} {
            {{#lambda.indented_12}}{{>libraries/ktor/_api_body}}{{/lambda.indented_12}}
        }
    }
    {{/featureLocations}}
    {{#featureLocations}}
    {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}} {
        {{#lambda.indented_8}}{{>libraries/ktor/_api_body}}{{/lambda.indented_8}}
    }
    {{/featureLocations}}
    {{#hasAuthMethods}}
    }
    {{/hasAuthMethods}}

{{/operation}}
}
{{/operations}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy