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.
15 lines
366 B
TypeScript
15 lines
366 B
TypeScript
import { App, fsRoutes, staticFiles, trailingSlashes } from "@fresh/core";
|
|
|
|
export const app = new App({ root: import.meta.url })
|
|
.use(staticFiles())
|
|
.use(trailingSlashes("never"));
|
|
|
|
await fsRoutes(app, {
|
|
loadIsland: (path) => import(`./islands/${path}`),
|
|
loadRoute: (path) => import(`./routes/${path}`),
|
|
});
|
|
|
|
if (import.meta.main) {
|
|
await app.listen();
|
|
}
|