# @inox-tools/custom-routing

> Define custom routing instead of Astro's default file-based routing.

Latest version **3.0.0** (published 2026-07-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @inox-tools/custom-routing
pnpm add @inox-tools/custom-routing
yarn add @inox-tools/custom-routing
bun add @inox-tools/custom-routing
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-07-18 |
| First published | 2024-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 145 |
| Author | Luiz Ferraz <luiz@lferraz.com> |
| Maintainers | fryuni |
| Keywords | astro-integration, withastro, utils |

## Links

- npm: https://www.npmjs.com/package/@inox-tools/custom-routing
- Repository: https://github.com/Fryuni/inox-tools
- npm.io page: https://npm.io/package/@inox-tools/custom-routing

## Recent versions

- 3.0.0 (latest) — 2026-07-18
- 1.0.0-beta.0 (beta) — 2024-11-02
- 2.0.0 — 2026-03-27
- 1.4.0 — 2026-02-15
- 1.3.0 — 2025-08-27
- 1.2.0 — 2025-07-19
- 1.1.0 — 2025-05-09
- 1.0.3 — 2025-01-01
- 1.0.2 — 2024-12-10
- 1.0.1 — 2024-12-04
- 1.0.0 — 2024-12-04
- 0.4.1 — 2024-10-05
- 0.4.0 — 2024-07-22
- 0.3.3 — 2024-07-18
- 0.3.2 — 2024-07-08
- … 5 more at https://npm.io/package/@inox-tools/custom-routing/versions

## README

<p align="center">
    <img alt="InoxTools" width="350px" src="https://github.com/Fryuni/inox-tools/blob/main/assets/shield.png?raw=true"/>
</p>

# Astro Custom Routing

This integration allows you to define custom routes for your Astro project independent of the file-system. Use whatever logic you want to define your routes.

```ts
// astro.config.mjs
import { customRouting } from '@inox-tools/custom-routing';

export default defineConfig({
  integrations: [
    customRouting({
      // Use Astro files outside of src/pages as the entrypoint
      '/blog/[...slug]': './src/routes/blog.astro',

      // Reuse the same entrypoint for more than one route for more precise control
      // here defining that the route should be only on the tag index and with a single segment
      tag: './src/routes/tags.astro',
      'tag/[tag]': './src/routes/tags.astro',

      // Publish common Astro files shared across projects as dependencies and use them here
      compliance: '@company/legal-pages/compliance.astro',
    }),
  ],
});
```

### License

Custom Routing is available under the MIT license.

---
_Source: https://npm.io/package/@inox-tools/custom-routing · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
