src/happyx/routing/mounting

Search:
Group by:

Mounting 🔌

Provides powerful and effective mounting ✨

Usage Example 🔨

mount Settings:
  "/":
    ...
mount Profile:
  mount "/settings" -> Settings
  mount "/config" -> Settings

serve(...):  # or appRoutes
  mount "/profile" -> Profile

Consts

registeredMounts = r"HappyXRegisteredMounts"

Procs

proc findAndReplaceMount(body: NimNode) {....raises: [ValueError], tags: [],
    forbids: [].}

âš  Low-level API âš 

Don't use it in product

Macros

macro mount(mountName, body: untyped): untyped
Registers new mount

Usage

mount User:
  get "/":
    "Hello, from user"

serve "127.0.0.1", 5000:
  mount "/user" -> User