Skip to content

Commit

Permalink
Update logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy Brauner committed Oct 27, 2022
1 parent 4b119c7 commit 79eccd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
18 changes: 3 additions & 15 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,11 @@ async function createProdServer() {
* Let's go!
*/
const isProd = process.env.NODE_ENV === "production"
const host = ip.address()
const host = process.env.HOST ?? ip.address()
const port = process.env.DOCKER_PORT ?? portFinderSync.getPort(3000)

if (!isProd) {
createDevServer().then(({ app }) =>
app.listen(port, () => {
console.log(`> ${palette.green(`Chersite node`)}`)
console.log(`> Local: ${palette.blue(`http://localhost:${port}`)}`)
console.log(`> Network: ${palette.blue(`http://${host}:${port}`)}`)
})
)
createDevServer().then(({ app }) => app.listen(port))
} else {
createProdServer().then(({ app }) =>
app.listen(port, () => {
console.log(`> ${palette.green(`Chersite node`)}`)
console.log(`> Local: ${palette.blue(`http://localhost:${port}`)}`)
console.log(`> Network: ${palette.blue(`http://${host}:${port}`)}`)
})
)
createProdServer().then(({ app }) => app.listen(port))
}
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
customLogger: chersiteCustomLogger({
protocol,
host: process.env.HOST,
port: process.env.DOCKER_APACHE_PORT,
port: process.env.PORT,
base: process.env.VITE_APP_BASE,
}),

Expand Down

0 comments on commit 79eccd6

Please sign in to comment.