Skip to content

Commit 0af6afb

Browse files
committed
bump
1 parent 52c8edd commit 0af6afb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.changeset/dirty-dolls-heal.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@builder.io/qwik-city': minor
3+
---
4+
5+
FEAT: Support rewrite feature. should work like redirect, but without modifying the address bar url
6+
7+
Example usage:
8+
```
9+
export const onRequest: RequestHandler = async ({ url, rewrite }) => {
10+
if (url.pathname.includes("/articles/the-best-article-in-the-world")) {
11+
const artistId = db.getArticleByName("the-best-article-in-the-world");
12+
13+
// Url will remain /articles/the-best-article-in-the-world, but under the hood,
14+
// will render /articles/${artistId}
15+
throw rewrite(`/articles/${artistId}`);
16+
}
17+
};
18+
```

0 commit comments

Comments
 (0)