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

com.fireflysource.example.HttpServerStaticFileDemo.kt Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package com.fireflysource.example

import com.fireflysource.`$`
import com.fireflysource.net.http.common.model.HttpMethod
import com.fireflysource.net.http.server.impl.router.handler.FileHandler

fun main() {
    `$`.httpServer()
        .router().method(HttpMethod.GET)
        .paths(listOf("/favicon.ico", "/poem.html", "/poem.txt"))
        .handler(FileHandler.createFileHandlerByResourcePath("files"))
        .listen("localhost", 8090)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy