From a58ec571e28e7f001f13daec016776bfa458ac6f Mon Sep 17 00:00:00 2001 From: Danny Spina Date: Mon, 19 Jun 2023 14:01:17 +0200 Subject: [PATCH] Ignore ts for poc --- index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index a45fde9..227711a 100644 --- a/index.ts +++ b/index.ts @@ -23,16 +23,23 @@ app.get("/", async (req, res) => { return } + const key = process.env.CYCLIC_BRAVE_KEY + + if (!key) { + throw new Error("No brave key found"); + } + fetch(`${searchEngine}?q=${query}`, { headers: { "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", - "X-Subscription-Token": process.env.CYCLIC_BRAVE_KEY, + "X-Subscription-Token": key, }, }) .then((page) => { page.json().then(response => { - const results = [] + const results: any[] = [] + // @ts-ignore response.web.results.forEach(result => { results.push(`