@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/index.js CHANGED
@@ -3711,7 +3711,6 @@ function requestLoggerMiddleware(options = {}) {
3711
3711
  const startTime = Date.now();
3712
3712
  res.on("finish", () => {
3713
3713
  const duration = Date.now() - startTime;
3714
- const shouldLogSuccess = logRequests === true;
3715
3714
  if (res.statusCode >= 500) {
3716
3715
  reqLogger.error(`${req.method} ${req.path} ${res.statusCode}`, {
3717
3716
  statusCode: res.statusCode,
@@ -3722,11 +3721,6 @@ function requestLoggerMiddleware(options = {}) {
3722
3721
  statusCode: res.statusCode,
3723
3722
  duration: `${duration}ms`
3724
3723
  });
3725
- } else if (shouldLogSuccess) {
3726
- reqLogger.debug(`${req.method} ${req.path} ${res.statusCode}`, {
3727
- statusCode: res.statusCode,
3728
- duration: `${duration}ms`
3729
- });
3730
3724
  }
3731
3725
  });
3732
3726
  }
@@ -4824,26 +4818,22 @@ async function startServer(options = {}) {
4824
4818
  });
4825
4819
  httpServer.listen(port, host, () => {
4826
4820
  if (isDev) {
4827
- logger3.info("\u{1F680} Dev server running", {
4828
- url: `http://${host}:${port}`,
4829
- appDir
4830
- });
4831
- logger3.info("\u{1F9ED} Reading routes from", { appDir });
4832
- logger3.info("\u{1F4E6} Client served from /static/client.js");
4821
+ const reset = "\x1B[0m";
4822
+ const cyan = "\x1B[36m";
4823
+ const green = "\x1B[32m";
4824
+ const dim = "\x1B[2m";
4825
+ const bold = "\x1B[1m";
4826
+ const url = `http://${host === "0.0.0.0" ? "localhost" : host}:${port}`;
4827
+ console.log();
4828
+ console.log(`${bold}${green}\u2713${reset} ${bold}Dev server ready${reset}`);
4829
+ console.log(`${dim} Local:${reset} ${cyan}${url}${reset}`);
4830
+ if (routes.length > 0 || apiRoutes.length > 0 || wssRoutes.length > 0) {
4831
+ console.log(`${dim} Routes:${reset} ${routes.length} pages, ${apiRoutes.length} API, ${wssRoutes.length} WSS`);
4832
+ }
4833
+ console.log();
4833
4834
  } else {
4834
- const buildDir = config.directories.build;
4835
- logger3.info("\u{1F680} Prod server running", {
4836
- url: `http://${host}:${port}`,
4837
- appDir,
4838
- buildDir
4839
- });
4840
- logger3.info("\u{1F9ED} Reading compiled routes from", { appDir });
4841
- logger3.info("\u{1F4E6} Client served from", {
4842
- path: `/static (${buildDir}/client)`
4843
- });
4844
- logger3.info("\u{1F4C4} SSG served from", {
4845
- path: `${buildDir}/ssg (if exists)`
4846
- });
4835
+ const url = `http://${host}:${port}`;
4836
+ console.log(`\u{1F680} Server running on ${url}`);
4847
4837
  }
4848
4838
  });
4849
4839
  }