Since v0.22.0 you can use powerful mounting with powerful routing 🥳
Mount declaration 🎈
nim
mount Settings:
"/":
....
mount Profile:
"/":
...
mount "/settings" -> Settings
Mount usage 🔥
nim
serve(...): You can use appRoutes for SPA also 🙂
mount "/profile" -> Profile
"/":
...
Mounts is REALLY powerful ⚡
You can use path params in mounting:
nim
serve(...): or appRoutes
mount "/<arg>/$id" -> SomeMount
Changelog
- Add mounting 🔥
- Add return statement for SSG apps ✨
nim
serve(...):
"/json":
return {"response": "..."}
"/html":
return buildHtml:
....
"/text":
return "Hello, world!"