@lolyjs/core 0.2.0-alpha.13 → 0.2.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -4208,7 +4208,6 @@ function requestLoggerMiddleware(options = {}) {
4208
4208
  const startTime = Date.now();
4209
4209
  res.on("finish", () => {
4210
4210
  const duration = Date.now() - startTime;
4211
- const shouldLogSuccess = logRequests === true;
4212
4211
  if (res.statusCode >= 500) {
4213
4212
  reqLogger.error(`${req.method} ${req.path} ${res.statusCode}`, {
4214
4213
  statusCode: res.statusCode,
@@ -4219,11 +4218,6 @@ function requestLoggerMiddleware(options = {}) {
4219
4218
  statusCode: res.statusCode,
4220
4219
  duration: `${duration}ms`
4221
4220
  });
4222
- } else if (shouldLogSuccess) {
4223
- reqLogger.debug(`${req.method} ${req.path} ${res.statusCode}`, {
4224
- statusCode: res.statusCode,
4225
- duration: `${duration}ms`
4226
- });
4227
4221
  }
4228
4222
  });
4229
4223
  }
@@ -5104,26 +5098,22 @@ async function startServer(options = {}) {
5104
5098
  });
5105
5099
  httpServer.listen(port, host, () => {
5106
5100
  if (isDev) {
5107
- logger3.info("\u{1F680} Dev server running", {
5108
- url: `http://${host}:${port}`,
5109
- appDir
5110
- });
5111
- logger3.info("\u{1F9ED} Reading routes from", { appDir });
5112
- logger3.info("\u{1F4E6} Client served from /static/client.js");
5101
+ const reset = "\x1B[0m";
5102
+ const cyan = "\x1B[36m";
5103
+ const green = "\x1B[32m";
5104
+ const dim = "\x1B[2m";
5105
+ const bold = "\x1B[1m";
5106
+ const url = `http://${host === "0.0.0.0" ? "localhost" : host}:${port}`;
5107
+ console.log();
5108
+ console.log(`${bold}${green}\u2713${reset} ${bold}Dev server ready${reset}`);
5109
+ console.log(`${dim} Local:${reset} ${cyan}${url}${reset}`);
5110
+ if (routes.length > 0 || apiRoutes.length > 0 || wssRoutes.length > 0) {
5111
+ console.log(`${dim} Routes:${reset} ${routes.length} pages, ${apiRoutes.length} API, ${wssRoutes.length} WSS`);
5112
+ }
5113
+ console.log();
5113
5114
  } else {
5114
- const buildDir = config.directories.build;
5115
- logger3.info("\u{1F680} Prod server running", {
5116
- url: `http://${host}:${port}`,
5117
- appDir,
5118
- buildDir
5119
- });
5120
- logger3.info("\u{1F9ED} Reading compiled routes from", { appDir });
5121
- logger3.info("\u{1F4E6} Client served from", {
5122
- path: `/static (${buildDir}/client)`
5123
- });
5124
- logger3.info("\u{1F4C4} SSG served from", {
5125
- path: `${buildDir}/ssg (if exists)`
5126
- });
5115
+ const url = `http://${host}:${port}`;
5116
+ console.log(`\u{1F680} Server running on ${url}`);
5127
5117
  }
5128
5118
  });
5129
5119
  }