This seems to be no longer needed thanks to https://github.com/denoland/deno/pull/27541. --------- Co-authored-by: Marvin Hagemeister <marvin@deno.com>
15 lines
360 B
TypeScript
15 lines
360 B
TypeScript
import { App, fsRoutes, staticFiles, trailingSlashes } from "fresh";
|
|
|
|
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();
|
|
}
|