diff --git a/src/server/index.ts b/src/server/index.ts index d5152d2..963dc23 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -14,6 +14,14 @@ const routes: Route[] = [ parameters?.pathname.groups.staticAsset ) }, + { + pattern: new URLPattern({ pathname: '/:page([^\.]*)' }), + handler: (request, _info, parameters) => { + console.log('page', parameters?.pathname.groups.page); + + return pageHandler(request, appDirectory, '') + } + }, { pattern: new URLPattern({ pathname: '/:asset' }), handler: (request, _info, parameters) => { @@ -26,14 +34,6 @@ const routes: Route[] = [ ); } }, - { - pattern: new URLPattern({ pathname: '/:page([^\.]*)' }), - handler: (request, _info, parameters) => { - console.log('page', parameters?.pathname.groups.page); - - return pageHandler(request, appDirectory, '') - } - } ]; Deno.serve( diff --git a/src/server/request_handler/page_handler.ts b/src/server/request_handler/page_handler.ts index b8ea4f1..0bb8ff8 100644 --- a/src/server/request_handler/page_handler.ts +++ b/src/server/request_handler/page_handler.ts @@ -15,8 +15,6 @@ export default function pageHandler( page : string | undefined, file : string = 'index.html' ) : Promise { - console.log('Serving:', `${root}/${page ?? ''}/${file}`); - return serveFile( request, `${root}/${page ?? ''}/${file}`