mirror of
https://github.com/cupcakearmy/blaze.git
synced 2024-12-22 16:26:26 +00:00
Ignore ts for poc
This commit is contained in:
parent
afa1804214
commit
a58ec571e2
11
index.ts
11
index.ts
@ -23,16 +23,23 @@ app.get("/", async (req, res) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const key = process.env.CYCLIC_BRAVE_KEY
|
||||||
|
|
||||||
|
if (!key) {
|
||||||
|
throw new Error("No brave key found");
|
||||||
|
}
|
||||||
|
|
||||||
fetch(`${searchEngine}?q=${query}`, {
|
fetch(`${searchEngine}?q=${query}`, {
|
||||||
headers: {
|
headers: {
|
||||||
"Accept": "*/*",
|
"Accept": "*/*",
|
||||||
"Accept-Encoding": "gzip, deflate, br",
|
"Accept-Encoding": "gzip, deflate, br",
|
||||||
"X-Subscription-Token": process.env.CYCLIC_BRAVE_KEY,
|
"X-Subscription-Token": key,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((page) => {
|
.then((page) => {
|
||||||
page.json().then(response => {
|
page.json().then(response => {
|
||||||
const results = []
|
const results: any[] = []
|
||||||
|
// @ts-ignore
|
||||||
response.web.results.forEach(result => {
|
response.web.results.forEach(result => {
|
||||||
results.push(`
|
results.push(`
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
Reference in New Issue
Block a user