www: add back trailing slash handling (#2467)

In Fresh 2 trailing slash handling isn't applied automatically anymore
and I forgot to do that when merging the Fresh 2 code base.

While we're at it, I've added a section for that to our migration guide.
This commit is contained in:
Marvin Hagemeister
2024-05-25 12:11:13 +02:00
committed by GitHub
parent 6a7f41f084
commit 5dd854341c
2 changed files with 18 additions and 2 deletions
+3 -2
View File
@@ -1,7 +1,8 @@
import { App, fsRoutes, staticFiles } from "@fresh/core";
import { App, fsRoutes, staticFiles, trailingSlashes } from "@fresh/core";
export const app = new App({ root: import.meta.url })
.use(staticFiles());
.use(staticFiles())
.use(trailingSlashes("never"));
await fsRoutes(app, {
loadIsland: (path) => import(`./islands/${path}`),