Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vordgi/nimpl-router
Edge router for next.js apps. Allows you to configure rewrites, redirects, i18n and basePath at the middleware level instead of next.config.js.
https://github.com/vordgi/nimpl-router
edge i18n middleware nextjs nextjs14
Last synced: 20 days ago
JSON representation
Edge router for next.js apps. Allows you to configure rewrites, redirects, i18n and basePath at the middleware level instead of next.config.js.
- Host: GitHub
- URL: https://github.com/vordgi/nimpl-router
- Owner: vordgi
- License: mit
- Created: 2024-06-24T17:15:57.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-10-23T19:06:57.000Z (2 months ago)
- Last Synced: 2024-11-28T16:50:38.439Z (25 days ago)
- Topics: edge, i18n, middleware, nextjs, nextjs14
- Language: TypeScript
- Homepage: https://nimpl.tech/router
- Size: 66.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @nimpl/router
Edge router for next.js apps. Allows you to configure rewrites, redirects, i18n and basePath at the middleware level instead of `next.config.js`
Visit https://nimpl.tech/docs/router to view the full documentation.
```js
import { createMiddleware } from "@nimpl/router";export const middleware = createMiddleware({
redirects: [
{
source: "/old",
destination: "/",
permanent: false,
},
],
rewrites: [
{
source: "/home",
destination: "/",
locale: false,
},
],
basePath: "/doc",
i18n: {
defaultLocale: "en",
locales: ["en", "de"],
},
});
```## Installation
**Using npm:**
```bash
npm i @nimpl/router
```**Using yarn:**
```bash
yarn add @nimpl/router
```## Additional
Please consider giving a star if you like it, it shows that the package is useful and helps continue work on this and other packages.
Create issues with wishes, ideas, difficulties, etc. All of them will definitely be considered and thought over.
## License
[MIT](https://github.com/vordgi/nimpl-router/blob/main/LICENSE)