raharrison / kotlin-ktor-exposed-starter Goto Github PK
View Code? Open in Web Editor NEWStarter RESTful service with websocket notifications using Kotlin, Ktor and Exposed with H2, HikariCP and FlyWay
Starter RESTful service with websocket notifications using Kotlin, Ktor and Exposed with H2, HikariCP and FlyWay
import org.jetbrains.exposed.sql.Table
unresolved reference:exposed.....
i have compile exposed successful like this: compile "org.jetbrains.exposed:exposed:0.10.4"
Would you mind to add support of Flyway or Liquibase?
Also, shouldn't the newSuspendedTransaction {}
block in DatabaseFactory
be using Dispatchers.IO
? That's how JetBrains does it in the Ktor docs.
Mostly, I'm just wondering why you would want Hikari set to isAutoCommit = false
.
Thanks!
Recent Kotlin versions have Coroutine IO (CIO) library. Do you think it's reasonable to migrate netty to CIO for this starter?
Need to be in same running instance
Hey @raharrison ,
this is probably a question only a total Kotlin newbie can ask- I do it anyway :)
I'm looking at different ktor example projects to learn its structure, and while I can start most of them with ./gradlew run
it seems I can't start yours. Can you let me know what I'm doing wrong?
I tried to find some explanation in the README. So once I get it to run I'm happy to provide a PR against your README (in case I didn't just miss the explanation).
My assumption is that I can run the service somehow- is run
the correct command?
Here's what's going wrong:
tuhlmann:~/.../kotlin/kotlin-ktor-exposed-starter$ ./gradlew run
> Task :run FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> No main class specified and classpath is not an executable jar.
Thanks,
Torsten.
Currently suspend on the incoming channel until exception is thrown.
Logs get cluttered with exceptions from Netty every time socket is closed
the port configuration is hard-coded, and the application.conf is ignored.
The following code would fix the issue
embeddedServer(Netty, commandLineEnvironment(args)).start(wait = true)
application.conf:
ktor {
deployment {
port = 8000
watch = [ build ]
}
application {
modules = [ MainKt.mainModule ]
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.