Skip to content

Commit

Permalink
improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
willybrauner committed Feb 22, 2024
1 parent 316cba8 commit f40551b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/front/server/server.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const INDEX_SERVER_PATH = `${config.srcDir}/server/index-server.tsx`
let KEY, CERT
if (IS_SSL) {
if (!(await mfs.fileExists("key.pem")) || !(await mfs.fileExists("cert.pem"))) {
// prettier-ignore
console.error("You need to generate a key and a cert file with openssl in the apps/front/ directory. Follow the README documentation 'setup-local-ssl'.")
console.error(
"You need to generate a key and a cert file with openssl in the apps/front/ directory. Follow the README documentation 'setup-local-ssl'."
)
process.exit(1)
}
KEY = await mfs.readFile("key.pem")
Expand All @@ -48,7 +49,6 @@ const INDEX_SERVER_PATH = `${config.srcDir}/server/index-server.tsx`
logLevel: "info",
server: {
middlewareMode: true,
// @ts-ignore
https: (IS_SSL && { key: KEY, cert: CERT }) || false,
cors: false
},
Expand Down
5 changes: 4 additions & 1 deletion apps/front/server/server.prod.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import chalk from "chalk"
import express from "express"
import fs from "node:fs/promises"
import portFinderSync from "portfinder-sync"
Expand Down Expand Up @@ -62,7 +63,9 @@ const CLIENT_PATH = "dist/client"

createProdServer().then(({ app }) =>
app.listen(PORT, () => {
console.log(`Server started at http://localhost:${PORT}`)
console.log(
`⚡️ ${chalk.white("server.prod is running in")} ${chalk.cyan(`http://localhost:${PORT}`)}`
)
})
)
})()

0 comments on commit f40551b

Please sign in to comment.