kroutes

Karax router with CSR and SSR support

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.2.0
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Authors

  • Evan Perry Grove

Installation

nimble install kroutes
choosenim install kroutes
git clone https://github.com/ryukoposting/kroutes

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
kroutes - - - - - - -

Dependencies

Package Version Optional
nim >= 1.6.10 No
karax >= 1.2.2 No

Source

Repository https://github.com/ryukoposting/kroutes
Homepage https://github.com/ryukoposting/kroutes
Registry Source nimble_official

README

KRoutes is a client-side router for karax.

Features

  • Easy to retrofit into existing Karax apps.
  • Support for both client-side and server-side HTML rendering.
  • Extensibility via method overloading.
  • Utility procs for site navigation.
  • Routing with path parameters.
  • Optional RAM-cached SSR responses to reduce server load.
  • Only one dependency: Karax (which you're using anyway, if you're using this package!)

Simple Example

include karax/prelude
import kroutes

let router = newRouter()

router.addRoute("/") do (ctx: Context) -> VNode:
  buildHtml(main):
    button(onclick = goto("/clicked")): text "Click the button."
    button(onclick = goto("/blog_post")): text "Go to the blog post."

router.addRoute("/clicked") do (ctx: Context) -> VNode:
  buildHtml(main):
    text "You clicked the button!"
    button(onclick = goBack()): text "Go back."

router.addSsrRoue("/blog_post")

setRenderer(router)

Demo app

The demo/ directory contains a simple web app using Prologue, Karax, and KRoutes. It uses both client-side and server-side rendering.