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

samplest.AppServer.kt Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package samplest

import restx.server.simple.simple.SimpleWebServer

fun main(args : Array) {
    val port = Integer.valueOf(System.getenv("PORT")?:"8080")
    val server = SimpleWebServer.builder().setRouterPath("/api").setPort(port).build()

    /*
         * load mode from system property if defined, or default to dev
         * be careful with that setting, if you use this class to launch your server in production, make sure to launch
         * it with -Drestx.mode=prod or change the default here
         */
    System.setProperty("restx.mode", System.getProperty("restx.mode", "dev"))

    server.startAndAwait()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy