# bloggify-flexible-router

> A flexible router for Bloggify apps.

Latest version **3.0.2** (published 2026-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install bloggify-flexible-router
pnpm add bloggify-flexible-router
yarn add bloggify-flexible-router
bun add bloggify-flexible-router
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2026-05-22 |
| First published | 2017-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 15.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Bloggify |
| Maintainers | ionicabizau |
| Keywords | bloggify, flexible, router, a, for, apps |

## Links

- npm: https://www.npmjs.com/package/bloggify-flexible-router
- Repository: https://github.com/Bloggify/flexible-router
- Homepage: https://github.com/Bloggify/flexible-router#readme
- Issues: https://github.com/Bloggify/flexible-router/issues
- npm.io page: https://npm.io/package/bloggify-flexible-router

## Dependencies (5)

- [typpy](https://npm.io/package/typpy.md) ^2.3.12
- [methods](https://npm.io/package/methods.md) ^1.1.2
- [set-or-get](https://npm.io/package/set-or-get.md) ^1.2.6
- [fs-file-tree](https://npm.io/package/fs-file-tree.md) ^1.1.1
- [iterate-object](https://npm.io/package/iterate-object.md) ^1.3.4

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.0.2 (latest) — 2026-05-22
- 3.0.1 — 2026-04-09
- 3.0.0 — 2026-04-05
- 2.1.0 — 2023-02-12
- 2.0.7 — 2020-09-30
- 2.0.6 — 2020-08-09
- 2.0.5 — 2020-07-14
- 2.0.4 — 2019-08-13
- 2.0.3 — 2018-10-02
- 2.0.2 — 2017-08-30
- 2.0.1 — 2017-08-29
- 2.0.0 — 2017-08-29
- 1.1.5 — 2017-08-20
- 1.1.4 — 2017-05-26
- 1.0.9 — 2017-05-26
- … 9 more at https://npm.io/package/bloggify-flexible-router/versions

## README

<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->


















# bloggify-flexible-router

 [![Version](https://img.shields.io/npm/v/bloggify-flexible-router.svg)](https://www.npmjs.com/package/bloggify-flexible-router) [![Downloads](https://img.shields.io/npm/dt/bloggify-flexible-router.svg)](https://www.npmjs.com/package/bloggify-flexible-router)







> A flexible router for Bloggify apps.

















## :cloud: Installation

```sh
# Using npm
npm install --save bloggify-flexible-router

# Using yarn
yarn add bloggify-flexible-router
```






















## :memo: Documentation


### Plugin Configuration

If the routes (default: `app/routes`) folder exists, it will dictate the routes structure. For example:

`_` is alias for `index`. `_foo` is alias for `:foo`

```
routes/
├── 404.ajs                    << 404 page
├── _.ajs                      << The index page (loaded on `/`)
├── api                        << Rest API (`/api`)
│   ├── index.js               << Api Handlers (e.g. sending a custom 404)
│   └── users                  << The `/api/users[/...]` endpoint
│       ├── index.js           << Handling `/api/users` (sending the list of users)
│       └── _username          << Handling `/api/users/:username`
│           └── index.js       << Fetching the user, by username, and sending it
└── users                      << The users list, in HTML format (`/users`)
    ├── _.ajs                  << The `/users` view
    ├── _.js                   << The `/users` controler
    └── _user                  << `/users/:user` endpoint
        ├── _.ajs              << View
        └── _.js               << Controller
```

The controller files look like this:

```js
// Before hook
exports.before = (ctx, cb) => ...

// After hook
exports.after = (ctx, cb) => ...

// Handle all the methods
// Alias for module.exports = ctx => ...
exports.all = ctx => ...

// Handle post requests
exports.post = ctx => ...
```

- **Object** `config`:
 - `routes_dir` (String): The path to the directory where the routes are stored. They should be randable view files. For dynamic routes, use the `_`character.

"/path/to/route": { controllerPath, viewPath }









## :question: Get Help

There are few ways to get help:



 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
 2. For bug reports and feature requests, open issues. :bug:














## :yum: How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].
























## :scroll: License

[MIT][license] © [Bloggify][website]






[license]: /LICENSE
[website]: https://bloggify.org
[contributing]: /CONTRIBUTING.md
[docs]: /DOCUMENTATION.md

---
_Source: https://npm.io/package/bloggify-flexible-router · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
