Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion init/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ ${GRADIENT_CSS}`;
import { define, type State } from "./utils.ts";

export const app = new App<State>();

app.use(staticFiles());

// this is the same as the /api/:name route defined via a file. feel free to delete this!
Expand All @@ -421,7 +422,6 @@ const exampleLoggerMiddleware = define.middleware((ctx) => {
app.use(exampleLoggerMiddleware);

await fsRoutes(app, {
dir: "./",
loadIsland: (path) => import(\`./islands/\${path}\`),
loadRoute: (path) => import(\`./routes/\${path}\`),
});
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/fs_routes/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ function isFreshFile<State>(mod: any): mod is FreshFsItem<State> {
}

export interface FsRoutesOptions {
/**
* Parent directory for the `/routes` and `/islands` folders.
*
* By default, the `root` config option of the provided app is used.
* @default app.config.root
*/
dir?: string;
ignoreFilePattern?: RegExp[];
loadRoute: (path: string) => Promise<unknown>;
Expand Down
Loading