https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
ktor
  • o

    orangy

    02/17/2017, 10:19 PM
    I have plenty of time to wait 🙂
    👍 1
    h
    • 2
    • 1
  • o

    orangy

    03/16/2017, 5:25 PM
    It requires JDK8, so I thought it makes sense to compile to 1.8 bytecode as well. That’s easy to revert, but is it causing any issues?
    r
    • 2
    • 3
  • c

    chillenious

    03/17/2017, 1:45 AM
    is there a way to get form posts automagically into a data class without using Locations?
    h
    • 2
    • 2
  • c

    cy

    03/17/2017, 10:41 AM
    404 response looks strange: jetty doesn't send 100 in some cases but 200 that is not an issue (so server could simply ignore Expect/Continue)
    r
    • 2
    • 1
  • q

    qwert_ukg

    03/17/2017, 11:27 AM
    can i use external JS libs directly in Kotlin, or only native?
    b
    • 2
    • 1
  • i

    impy

    03/18/2017, 11:02 PM
    @hhariri other than what exactly?
    h
    • 2
    • 1
  • h

    hhariri

    03/19/2017, 6:55 AM
    I wonder if that means that people have finally agreed on what a RESTful API means, other than “pretty URL’s returning JSON” 🙂
    s
    o
    • 3
    • 8
  • s

    spand

    04/04/2017, 9:51 AM
    fun Application.main() {
        install(CallLogging)
        install(Routing) {
            get("/") {
                throw Exception("Foo")
                call.respondText("Hello, World!")
            }
        }
    }
    Produces a 404
    o
    • 2
    • 10
  • o

    orangy

    04/17/2017, 9:09 AM
    Working on static content DSL right now
    h
    • 2
    • 2
  • r

    rachit

    05/22/2017, 10:11 AM
    @mrtact did you resolve the DevelopmentHost issue?
    m
    • 2
    • 1
  • c

    cy

    05/22/2017, 12:42 PM
    your main class should be
    com.practo.MainKt
    r
    • 2
    • 2
  • r

    rachit

    05/22/2017, 1:05 PM
    in
    is a keyword in kotlin, so i can't have a package name like
    <http://in.xyz|in.xyz>
    😮
    • 1
    • 1
  • a

    artemiy

    05/23/2017, 4:45 PM
    I'm using withTestApplication and handleRequest for testing, is there any way to set a timeout? Might be useful, it's async code and tests can just hang forever if call.respond wasn't called
    • 1
    • 1
  • c

    codeslubber

    05/31/2017, 5:35 PM
    can you see this @orangy ? : https://github.com/codeslubber/kstaticgen
    o
    • 2
    • 23
  • o

    orangy

    06/01/2017, 6:50 PM
    Thanks 🙂 What version are you using?
    w
    • 2
    • 1
  • q

    qwert_ukg

    06/08/2017, 6:06 AM
    the question is open, where i can get latest version of KotlinX.html?
    g
    • 2
    • 2
  • o

    orangy

    06/16/2017, 1:12 PM
    I personally prefer functional structure. So you have a
    main
    function which installs all the features, opens
    routing
    and then calls functions for various parts of the system.
    public Application.main() {
      install(…) 
      install(…) 
      routing {
          users() // user routes
          articles() // article routes
      }
    }
    
    // in other file
    fun Route.users() {
       get("users") {…}
    }
    i
    • 2
    • 4
  • a

    avolkmann

    06/20/2017, 4:02 PM
    Can I somehow Intercept at the end of a call ?
    o
    • 2
    • 6
  • t

    thisen

    06/24/2017, 9:36 PM
    Any plans on making Ktor support GraphQL?
    👍 1
    h
    • 2
    • 5
  • o

    orangy

    06/26/2017, 4:16 PM
    static("static") {
                    resources("static")
                }
    👍 1
    t
    • 2
    • 2
  • t

    thisen

    06/29/2017, 10:19 AM
    If I use the following approach, how do I get Gradle to run the project?
    fun Application.main() {
        install(DefaultHeaders)
        install(Routing) {
            get("/") {
                call.respondText("Hello, World!")
            }
        }
    }
    g
    • 2
    • 1
  • j

    juliocbcotta

    07/03/2017, 5:46 PM
    Orange, is there any particular reason to prefer Guice over Dagger ?
    o
    • 2
    • 7
  • o

    orangy

    07/04/2017, 3:21 PM
    From what I read, I cannot really understand how Lambda and #ktor can really work together. Can you explain it to me?
    d
    • 2
    • 11
  • t

    trevjones

    07/06/2017, 5:28 PM
    @orangy I think I have most if not all of your feedback incorporated into the repo now. https://github.com/trevjonez/ktor_playground Ended up dropping the streaming stuff so that everything goes through the normal interceptor flow. I will probably look into using some socket to get the stream behavior I wanted at a later date.
    o
    • 2
    • 1
  • j

    juliocbcotta

    07/07/2017, 6:02 PM
    Orangy, how about to update the ktor wiki with the contents of the ktor-wiki repo ?
    👍 1
    o
    • 2
    • 1
  • a

    avolkmann

    07/11/2017, 10:50 AM
    It would be nice to be able to set the response code based on the Exception.
    o
    • 2
    • 1
  • p

    poohbar

    07/11/2017, 11:12 AM
    Ilya, no way JetBrains could embrace ktor and actually pay you guys to work on it? Just wondering.
    o
    s
    j
    • 4
    • 4
  • m

    mkporwit

    07/18/2017, 5:40 PM
    I can ask if we've got the bandwidth to take a stab at JWT auth and contribute it back to ktor...
    h
    • 2
    • 2
  • o

    orangy

    07/19/2017, 2:12 PM
    📣 Version poll I’m using: 1️⃣ 0.3.2 or earlier 2️⃣ 0.3.3 3️⃣ 0.4.0 alpha
    3️⃣ 6
    1️⃣ 1
    2️⃣ 5
    r
    • 2
    • 4
  • e

    emuz

    07/20/2017, 12:37 PM
    Hey there, does anyone have an example of a pretty complex API in ktor I can have a look at? I've seen tutorials telling you how to make a simple one, but I want to know how to structure an API with a fair amount of logic
    h
    • 2
    • 2
Powered by Linen
Title
e

emuz

07/20/2017, 12:37 PM
Hey there, does anyone have an example of a pretty complex API in ktor I can have a look at? I've seen tutorials telling you how to make a simple one, but I want to know how to structure an API with a fair amount of logic
h

hhariri

07/20/2017, 1:53 PM
Have you checked out https://github.com/Kotlin/ktor/blob/master/ktor-samples/you-kube sample?
You can define and separate modules of functionality using routes https://github.com/Kotlin/ktor/blob/master/ktor-samples/you-kube/src/you/kube/App.kt#L64
View count: 1