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);