Graphical PDS migrator for AT Protocol
1/// <reference lib="deno.unstable" />
2
3import { App, fsRoutes, staticFiles } from "fresh";
4import { define, type State } from "./utils.ts";
5
6export const app = new App<State>();
7
8app.use(staticFiles());
9
10// this can also be defined via a file. feel free to delete this!
11const exampleLoggerMiddleware = define.middleware((ctx) => {
12 console.log(`${ctx.req.method} ${ctx.req.url}`);
13 return ctx.next();
14});
15app.use(exampleLoggerMiddleware);
16
17await fsRoutes(app, {
18 loadIsland: (path) => import(`./islands/${path}`),
19 loadRoute: (path) => import(`./routes/${path}`),
20});
21
22if (import.meta.main) {
23 await app.listen();
24}