Fork me on GitHub
  1. What you should know
  2. Adding a Kweb dependency
    1. Additions to build.gradle
  3. Logging

What you should know

Kweb is built on Kotlin 1.1, you should have some familiarity to Kotlin and the Java ecosystem on which it’s built.

Adding a Kweb dependency

The Kweb library is distributed via JitPack, it can be added easily to any Kotlin project:

Additions to build.gradle

For Gradle users, add this to the repositories section of your build.gradle:

  repositories {
    // ...
    maven { url '' }
    maven {url ""}

Then add this to the dependencies section of your build.gradle:

dependencies {
  // ...
  compile 'com.github.kwebio:kweb:MAVEN_VERSION_PLACEHOLDER'
  compile 'org.slf4j:slf4j-simple:1.6.1' // <-- or your favorite SLF4J logger binding 


Kweb uses SLF4J for logging. This is a “logging facade”, it allows libraries to log to the library user’s preferred logging framework. The instructions above include the “simple” SLF4J logger binding, but you can replace this to a number of others, depending on your needs or preferences, learn more here.

If you see an error like the following:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.

…it means that you have not provided an SLF4J logging implementation. This is undesirable because Kweb provides some useful warnings that you won’t see without this.

Next: Your First Kwebsite »»