# Installation
# Direct Download / CDN
https://unpkg.com/kdu-router/dist/kdu-router.js (opens new window)
Unpkg.com (opens new window) provides npm-based CDN links. The above link will always point to the latest release on npm. You can also use a specific version/tag via URLs like https://unpkg.com/kdu-router@3.0.0/dist/kdu-router.js
.
Include kdu-router
after Kdu and it will install itself automatically:
<script src="/path/to/kdu.js"></script>
<script src="/path/to/kdu-router.js"></script>
# npm
npm install kdu-router
When used with a module system, you must explicitly install the router via Kdu.use()
:
import Kdu from 'kdu'
import KduRouter from 'kdu-router'
Kdu.use(KduRouter)
You don't need to do this when using global script tags.
# Kdu CLI
If you have a project using Kdu CLI (opens new window) you can add Kdu Router as a plugin. You can let the CLI generate the code above for you as well as two sample routes. It will also overwrite your App.kdu
so make sure to backup the file before running the following command inside your project:
kdu add router