From dd2e98ccd9cecf2a9b57ccf1ce5e8cec3bb22423 Mon Sep 17 00:00:00 2001 From: Andy Burke Date: Sun, 22 Jun 2025 13:36:44 -0700 Subject: [PATCH] fix: try to address issues running serverus from jsr.io --- deno.json | 2 +- server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deno.json b/deno.json index 1cec2b7..c6db87d 100644 --- a/deno.json +++ b/deno.json @@ -1,7 +1,7 @@ { "name": "@andyburke/serverus", "description": "A flexible HTTP server for mixed content. Throw static files, markdown, Typescript and (hopefully, eventually) more into a directory and serverus can serve it up a bit more like old-school CGI.", - "version": "0.0.4", + "version": "0.0.5", "license": "MIT", "exports": { ".": "./serverus.ts", diff --git a/server.ts b/server.ts index aa25279..c3bfcd5 100644 --- a/server.ts +++ b/server.ts @@ -7,7 +7,7 @@ import * as colors from '@std/fmt/colors'; import * as fs from '@std/fs'; import * as path from '@std/path'; -const DEFAULT_HANDLER_DIRECTORIES = [path.resolve(path.join(path.dirname(path.fromFileUrl(import.meta.url)), 'handlers'))]; +const DEFAULT_HANDLER_DIRECTORIES = [path.join(import.meta.dirname ?? '.', 'handlers')]; /** A `HANDLER` must take a `Request` and return a `Response` if it can handle it. */ type HANDLER = (request: Request) => Promise | Response | null | undefined;