fix: try to better handle directories and loading handlers both locally

and remotely
This commit is contained in:
Andy Burke 2025-06-24 12:06:09 -07:00
parent 5d25afc329
commit 5ee654f280
3 changed files with 10 additions and 8 deletions

View file

@ -102,9 +102,12 @@ export class SERVER {
this.controller = new AbortController();
const { signal } = this.controller;
const HANDLERS_DIRECTORIES: string[] =
Deno.env.get('SERVERUS_HANDLERS')?.split(/[;:]/g)?.filter((dir) => dir.length > 0)?.map((dir) => path.resolve(dir)) ??
DEFAULT_HANDLER_DIRECTORIES;
const HANDLERS_DIRECTORIES: string[] = Deno.env.get('SERVERUS_HANDLERS')
?.split(/[;]/g)
?.filter((dir) => dir.length > 0)
?.map((dir) => {
return dir.includes('://') ? dir : path.resolve(dir);
}) ?? DEFAULT_HANDLER_DIRECTORIES;
for (const handler_directory of HANDLERS_DIRECTORIES) {
const index_file = path.join(handler_directory, 'index.ts');