feature: add SERVERUS_TYPESCRIPT_IMPORT_LOGGING environment variable

feature(wip): reload on changes
This commit is contained in:
Andy Burke 2025-06-25 16:53:45 -07:00
parent 62eba8612b
commit 26125f4f11
5 changed files with 18 additions and 7 deletions

View file

@ -74,6 +74,11 @@ export default async function handle_typescript(request: Request): Promise<Respo
const module: ROUTE_HANDLER = await import(import_path) as ROUTE_HANDLER;
const pattern = new URLPattern({ pathname: route_path });
if (Deno.env.get('SERVERUS_TYPESCRIPT_IMPORT_LOGGING')) {
console.log(`imported: ${import_path}`);
}
routes.set(pattern, module);
} catch (error) {
console.error(`Error mounting module ${import_path} at ${route_path}\n\n${error}\n`);