From 542697bcbe5549a84c72eeef619718e9990667c4 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 6 Mar 2022 20:59:53 +0300 Subject: [PATCH] add moment formatting --- server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index e7820e26..7338c29c 100644 --- a/server.js +++ b/server.js @@ -15,6 +15,7 @@ along with this program. If not, see https://www.gnu.org/licenses/. */ const path = require("path"); +const moment = require("moment"); const templateDir = path.resolve(`${process.cwd()}${path.sep}html`); var express = require("express"); var app = express(); @@ -83,7 +84,7 @@ app.get("/watch", async function (req, res) { title: json, a:json, video: json, - date: json.uploadDate, + date: moment(json.uploadDate).format("LL"), e:e, lyrics: lyrics.replace(/\n/g, "
"), }); @@ -92,7 +93,7 @@ app.get("/", function (req, res) { renderTemplate(res, req, "ytmain.ejs"); }); -app.get("/youtube/ara", async (req, res) => { +app.get("/api/search", async (req, res) => { const query = req.query.query; if (!query) {