From 81d7efaf2beb26940ab25f14fb3a186d4f5d36eb Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Wed, 25 Jun 2025 17:21:33 +0000 Subject: [PATCH] fix DB table creation, remove log line --- .../output/functions/api.func/router.js | 15 +-------------- src/common/database.js | 3 ++- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/_dot_vercel_copy/output/functions/api.func/router.js b/_dot_vercel_copy/output/functions/api.func/router.js index d4d73041..0fa0f5ae 100644 --- a/_dot_vercel_copy/output/functions/api.func/router.js +++ b/_dot_vercel_copy/output/functions/api.func/router.js @@ -2,6 +2,7 @@ import { default as gist } from "./api/gist.js"; import { default as pin } from "./api/pin.js"; export default async (req, res) => { + // remaining code expects express.js-like request and response objects res.send = function (data) { if (typeof data === "object") { res.setHeader("Content-Type", "application/json"); @@ -17,20 +18,6 @@ export default async (req, res) => { const url = new URL(req.url, "https://localhost"); req.query = Object.fromEntries(url.searchParams.entries()); - console.log( - JSON.stringify(req.query) + - " # " + - req.method + - " # " + - JSON.stringify(req.headers) + - " # " + - res.setHeader + - " # " + - res.send + - " # " + - res.status, - ); - switch (url.pathname) { case "/gist": gist(req, res); diff --git a/src/common/database.js b/src/common/database.js index 15246c28..31850148 100644 --- a/src/common/database.js +++ b/src/common/database.js @@ -39,7 +39,8 @@ export async function storeRequest(req) { const createTableQuery = ` CREATE TABLE IF NOT EXISTS requests ( request TEXT PRIMARY KEY, - requested_at TIMESTAMP NOT NULL DEFAULT now() + requested_at TIMESTAMP NOT NULL DEFAULT now(), + user_requested_at TIMESTAMP NOT NULL DEFAULT now() ) `; await pool.query(createTableQuery);