Skip to content

Commit

Permalink
lint: no shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy committed Dec 21, 2023
1 parent ef7a412 commit 4e4152d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/astro/src/runtime/server/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function renderEndpoint(
const method = request.method.toUpperCase();
// use the exact match on `method`, fallback to ALL
const handler = mod[method] ?? mod['ALL'];
if (!ssr && ssr === false && method && method !== 'GET') {
if (!ssr && ssr === false && method !== 'GET') {
logger.warn(
"router",
`${url.pathname} ${bold(
Expand All @@ -26,7 +26,8 @@ export async function renderEndpoint(
logger.warn(
'router',
`No API Route handler exists for the method "${method}" for the route ${url.pathname}.\n` +
`Found handlers: ${Object.keys(mod).map(method => JSON.stringify(method)).join(', ')}\n`
`Found handlers: ${Object.keys(mod).map(exp => JSON.stringify(exp)).join(', ')}\n` +
'all' in mod ? `One of the exported handlers is 'all' (lowercase), did you mean to export 'ALL'?` : ''
);
// No handler found, so this should be a 404. Using a custom header
// to signal to the renderer that this is an internal 404 that should
Expand Down

0 comments on commit 4e4152d

Please sign in to comment.