Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Dahlberg committed Dec 31, 2024
1 parent 721b5ec commit 3f6aabf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/next/src/cli/next-start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const nextStart = async (options: NextStartOptions, directory?: string) => {
const dir = getProjectDir(directory)
const hostname = options.hostname
const port = options.port
const accessLog = options.accessLog;
const accessLog = options.accessLog
const keepAliveTimeout = options.keepAliveTimeout

if (isPortIsReserved(port)) {
Expand All @@ -39,7 +39,7 @@ const nextStart = async (options: NextStartOptions, directory?: string) => {
hostname,
port,
keepAliveTimeout,
accessLog
accessLog,
})
}

Expand Down
11 changes: 7 additions & 4 deletions packages/next/src/server/lib/start-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,15 @@ export async function startServer(
}

async function requestListener(req: IncomingMessage, res: ServerResponse) {
if(accessLog) {
if (accessLog) {
try {
fs.appendFileSync(accessLog, `${new Date().toISOString()} ${req.method} ${req.url} ${req.headers['user-agent']}\n`);
fs.appendFileSync(
accessLog,
`${new Date().toISOString()} ${req.method} ${req.url} ${req.headers['user-agent']}\n`
)
} catch (err) {
Log.error(`Failed to write to access log: ${accessLog}`);
console.error(err);
Log.error(`Failed to write to access log: ${accessLog}`)
console.error(err)
}
}
try {
Expand Down

0 comments on commit 3f6aabf

Please sign in to comment.