import { Context, Next, send } from "@oak/oak"; export function routeStaticFilesFrom(staticPaths: string[]) { return async (context: Context>, next: Next) => { for (const path of staticPaths) { try { await send(context, context.request.url.pathname, { root: path, index: "index.html", }); return; } catch { continue; } } await next(); }; }