mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Print URL to open dev server in a browser
This commit is contained in:
parent
ef66a19e20
commit
7c2ceaf41f
1 changed files with 6 additions and 1 deletions
|
|
@ -73,6 +73,8 @@ function render(url, context) {
|
|||
});
|
||||
}
|
||||
|
||||
const env = process.env.NODE_ENV;
|
||||
const dev = env !== 'production';
|
||||
const PORT = process.env.port || 4000;
|
||||
const app = express();
|
||||
|
||||
|
|
@ -100,5 +102,8 @@ app.get('*', (req, res) => {
|
|||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Listening to port ${PORT} in ${process.env.NODE_ENV} mode`);
|
||||
console.log(`Listening to port ${PORT} in ${env} mode`);
|
||||
if (dev) {
|
||||
console.log(`Open http://localhost:${PORT}/ and start hacking!`);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue