From 08f8e3b4a4879dd7c91c16fbce80c4f2bc5e357f Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 10 Jul 2023 02:32:24 +0000
Subject: [PATCH] docs + various polish

---
 quartz/build.ts |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/quartz/build.ts b/quartz/build.ts
index 752f57a..36e3210 100644
--- a/quartz/build.ts
+++ b/quartz/build.ts
@@ -54,21 +54,16 @@
 
   if (argv.serve) {
     const server = http.createServer(async (req, res) => {
-      let status = 200
-      const result = await serveHandler(req, res, {
+      await serveHandler(req, res, {
         public: output,
         directoryListing: false,
-      }, {
-        async sendError() {
-          status = 404
-        },
       })
+      const status = res.statusCode
       const statusString = status === 200 ? chalk.green(`[${status}]`) : chalk.red(`[${status}]`)
       console.log(statusString + chalk.grey(` ${req.url}`))
-      return result
     })
     server.listen(argv.port)
-    console.log(`Started a Quartz server listening at http://localhost:${argv.port}`)
+    console.log(chalk.cyan(`Started a Quartz server listening at http://localhost:${argv.port}`))
     console.log('hint: exit with ctrl+c')
   }
 }

--
Gitblit v1.10.0