https://github.com/ujjwalguptaofficial/mahal-router
https://github.com/ujjwalguptaofficial/mahal-router
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ujjwalguptaofficial/mahal-router
- Owner: ujjwalguptaofficial
- License: apache-2.0
- Created: 2021-03-03T01:14:12.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-16T12:45:46.000Z (over 2 years ago)
- Last Synced: 2025-03-06T02:47:19.030Z (8 months ago)
- Language: JavaScript
- Size: 1.67 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://badge.fury.io/js/@mahaljs%2Frouter)
[](https://github.com/ujjwalguptaofficial/mahal-router/actions/workflows/test.yml)# mahal-router
Official router plugin for [Mahal framework](https://github.com/ujjwalguptaofficial/mahal)
# Install
```
npm i @mahaljs/router
```# Setup
```
import { Timer, Mahal } from "mahal";
import Root from "./components/root.mahal";
import { RouterPlugin, Router } from "@mahaljs/router";
import { routes } from "./routes";const router = new Router(routes, {
mode: "history"
});const app = new Mahal(Root, '#app');
// add router as plugin
app.extend.plugin(RouterPlugin, router);app.create();
```
# Docs
https://mahaljs.com/docs/router/