Please, improve this code: const express = require("express"); const fs = require("fs"); const path = require("path"); const markdownIt = require("markdown-it")(); const matter = require("gray-matter");  const app = express(); const PORT = process.env.PORT || 3000;  app.set("view engine", "ejs"); app.use(express.static(path.join(__dirname, "public")));  app.get("/", (req, res) => {   console.log("User-Agent:", req.headers["user-agent"], '[HOME]');   // Get the list of markdown files in the content directory   const contentDir = path.join(__dirname, "content");   const files = fs.readdirSync(contentDir);    // Read the contents of each file and extract the front matter data   const pages = files.map((file) => {     const filePath = path.join(contentDir, file);     const fileContent = fs.readFileSync(filePath, "utf-8");     const { data } = matter(fileContent);     data.fileName = file.replace(".md", "");     return data;   });    // Sort the pages by their last edited date   pages.sort((a, b) => new Date(b.date) - new Date(a.date));    // Render the homepage view   res.render("home", { pages }); });  app.get("/:fileName", (req, res) => {   console.log("User-Agent:", req.headers["user-agent"], '[PAGE]');    const fileName = req.params.fileName;   const filePath = path.join(__dirname, "content", fileName + ".md");    try {     const fileContent = fs.readFileSync(filePath, "utf-8");     const { data, content } = matter(fileContent);     const htmlContent = markdownIt.render(content);      res.render("page", { ...data, content: htmlContent });   } catch (err) {     res.status(404).send("Page not found");   } });  app.listen(PORT, () => {   console.log(`Server running on http://localhost:${PORT}`); }); Your response should contain less than 300 words.
user