JanMalch / ktor-revfile

Ktor server plugin for automatically revisioning static files.

Home Page:https://janmalch.github.io/ktor-revfile/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ktor RevFile

A Ktor server plugin made for automatically revisioning static files.

A revisioned file will include a short hash of its content in the file name. This enables optimal caching without you ever having to change the name of the local file.

Usage

package com.example

object AppAssets : RevFileRegistry("/assets/") {
    val main = resource("main.js")
    val styles = resource("styles.css")
}

fun Application.module() {
    install(RevFilePlugin) {
        +AppAssets
    }
}

Checkout the complete documentation for usage details.

About

Ktor server plugin for automatically revisioning static files.

https://janmalch.github.io/ktor-revfile/

License:Apache License 2.0


Languages

Language:Kotlin 99.6%Language:JavaScript 0.4%