@@ -52,23 +52,15 @@ async function checkPortAvailability() {
5252async function startServer ( ) {
5353 const app = createApp ( )
5454
55- // If in a deployed environment...
56- if ( NODE_ENV === 'production' ) {
57- // If in a true production environment, wait for the cache to be fully warmed.
58- if ( process . env . HEROKU_PRODUCTION_APP || process . env . GITHUB_ACTIONS ) {
59- await warmServer ( )
60- }
61- } else {
62- // Warm up as soon as possible when in development.
63- // The `warmServer()` function is idempotent and it will soon be used
64- // by some middleware, but there's no point in having a started server
65- // without this warmed up. Besides, by starting this slow thing now,
66- // it can start immediately instead of waiting for the first request
67- // to trigger it to warm up. That way, when in development and triggering
68- // a `nodemon` restart, there's a good chance the warm up has come some
69- // way before you manage to reach for your browser to do a page refresh.
70- await warmServer ( )
71- }
55+ // Warm up as soon as possible.
56+ // The `warmServer()` function is idempotent and it will soon be used
57+ // by some middleware, but there's no point in having a started server
58+ // without this warmed up. Besides, by starting this slow thing now,
59+ // it can start immediately instead of waiting for the first request
60+ // to trigger it to warm up. That way, when in development and triggering
61+ // a `nodemon` restart, there's a good chance the warm up has come some
62+ // way before you manage to reach for your browser to do a page refresh.
63+ await warmServer ( )
7264
7365 // Workaround for https://github.com/expressjs/express/issues/1101
7466 const server = http . createServer ( app )
0 commit comments