Skip to content

Commit

Permalink
Show activity for HTML rendering + renable socket.io so server doesn'…
Browse files Browse the repository at this point in the history
…t crash
  • Loading branch information
KyleAMathews committed Oct 13, 2020
1 parent da624c5 commit 89b671c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/gatsby/src/utils/start-server.ts
Expand Up @@ -256,8 +256,11 @@ export async function startServer(
return next()
}

// const htmlActivity = report.phantomActivity(`building index.html`, {})
// htmlActivity.start()
const htmlActivity = report.activityTimer(
`building HTML for path "${req.path}"`,
{}
)
htmlActivity.start()

const [response] = await renderHTML({
htmlComponentRendererPath: `${program.directory}/public/render-page.js`,
Expand All @@ -272,9 +275,9 @@ export async function startServer(
],
})

return res.status(200).send(response)

// htmlActivity.end()
// TODO add support for 404 and general rendering errors
htmlActivity.end()
res.status(200).send(response)
})

// Disable directory indexing i.e. serving index.html from a directory.
Expand All @@ -288,7 +291,7 @@ export async function startServer(
**/
const server = new http.Server(app)

// const socket = websocketManager.init({ server, directory: program.directory })
const socket = websocketManager.init({ server, directory: program.directory })

// hardcoded `localhost`, because host should match `target` we set
// in http proxy in `develop-proxy`
Expand Down

0 comments on commit 89b671c

Please sign in to comment.