title: Is it possible to build a full Node.js web application using Kotlin?
body: <p>If I understand correctly, with <a href="https://blog.jetbrains.com/kotlin/2017/01/kotlin-1-1-beta-is-here/" rel="noreferrer">the release of Kotlin 1.1</a>, we can <a href="https://kotlinlang.org/docs/reference/js-overview.html" rel="noreferrer">set JavaScript as a compile target</a> for full compilation to JavaScript of Kotlin projects. Is it possible (or feasible) to write an entire Node.js application, such as an express webserver, using only Kotlin code?</p>
  
  <p>As <a href="https://stackoverflow.com/q/44642521/5209322">this question</a> suggests, we can import Node modules into Kotlin classes:</p>
  
  <pre class="lang-kotlin prettyprint-override"><code>external fun require(module: String): dynamic
  
  val express = require('express')
  </code></pre>
  
  <p>...which seems like I can create an application using: </p>
  
  <pre><code>val app = express()
  </code></pre>
  
  <p>Is this the <em>Kotlin way</em> to set up an express application? Or should I declare a class as <a href="https://kotlinlang.org/docs/reference/js-modules.html" rel="noreferrer">described in the docs</a>: </p>
  
  <pre><code>@JsModule("express")
  external class Express { ... }
  </code></pre>
  
  <p>What is the canonical way to set up a Kotlin project for Node.js application development? Is Kotlin's JavaScript interoperability robust enough to continue down this path, or will it be more trouble than it's worth?</p>