Skip to content

Commit

Permalink
optimize slice path
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuapp committed Nov 26, 2024
1 parent 86ec827 commit 5a8553b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/middleware/logger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ function log(
*/
export const logger = (fn: PrintFunc = console.log): MiddlewareHandler => {
return async function logger(c, next) {
const { method } = c.req
const { method, url } = c.req

const url = new URL(c.req.raw.url)
const path = url.pathname + url.search
const path = url.slice(url.indexOf('/', 8))

log(fn, LogPrefix.Incoming, method, path)

Expand Down

0 comments on commit 5a8553b

Please sign in to comment.