I really want to make the web development story in Nim happen, in particular, the frontend part of it.
Although I am not a frontend developer myself, I've spent some time playing around with Karax and quickly realized there are obvious missing parts.
One of those low hanging fruit is routing. I want routing that is obvious, extensible, and unbloated.
And thus, behold Kraut. Kraut is a tiny lib that allows you to think in routes instead of hash parts and URL params instead of split strings. The routes are defined with Nim's built-in key-value sugar, so you have nothing new to learn:
let routes = {"#/path/{param}/subpath/": rendererProc,}
The requirements for the renderer price are also very simple: they must accept a Context instance and return a VNode.
Name: Kraut
Author: moigagoo
Posting:
I really want to make the web development story in Nim happen, in particular, the frontend part of it.
Although I am not a frontend developer myself, I've spent some time playing around with Karax and quickly realized there are obvious missing parts.
One of those low hanging fruit is routing. I want routing that is obvious, extensible, and unbloated.
And thus, behold Kraut. Kraut is a tiny lib that allows you to think in routes instead of hash parts and URL params instead of split strings. The routes are defined with Nim's built-in key-value sugar, so you have nothing new to learn:
The requirements for the renderer price are also very simple: they must accept a
Context
instance and return aVNode
.See the docs and a full working example in the repo: https://github.com/moigagoo/kraut