Skip to content

Commit

Permalink
🎨 Format
Browse files Browse the repository at this point in the history
  • Loading branch information
SPGoding committed Jan 19, 2025
1 parent 303e1b3 commit fb9e67e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/web-api-server/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,16 @@ export const loggerMiddleware = (req: Request, res: Response, next: NextFunction
const start = new Date()
console.info(
chalk.yellow(
`[${start.toISOString()}] ${req.method} ${req.path} by ${req.ip} - ${req.headers['user-agent']
`[${start.toISOString()}] ${req.method} ${req.path} by ${req.ip} - ${
req.headers['user-agent']
}...`,
),
)
res.on('finish', () => {
const end = new Date()
const message =
`[${end.toISOString()}] ${req.method} ${req.path} by ${req.ip} - ${res.statusCode} - ${end.getTime() - start.getTime()
`[${end.toISOString()}] ${req.method} ${req.path} by ${req.ip} - ${res.statusCode} - ${
end.getTime() - start.getTime()
}ms`
console.info(res.statusCode < 400 ? chalk.green(message) : chalk.red(message))
})
Expand Down Expand Up @@ -240,7 +242,7 @@ export const expensiveRateLimiter = getRateLimiter(EXPENSIVE_REQUEST_POINTS)
export class MemCache {
#versions: { id: string }[] | undefined

constructor(private readonly mcmetaGit: SimpleGit) { }
constructor(private readonly mcmetaGit: SimpleGit) {}

async getVersions() {
if (!this.#versions) {
Expand Down

0 comments on commit fb9e67e

Please sign in to comment.