mirror of
https://github.com/blazblue547-afk/neonex.git
synced 2026-12-02 14:54:17 -05:00
Add pagination: Next/Prev buttons, offset support across proxy & Netlify function
This commit is contained in:
1 parent
4c63fa5b8b
commit
6428b51d01
3 files changed
+296
-57
No files matched your search
@@ -23,6 +23,7 @@ exports.handler = async (event) => {
|
||||
|
||||
const query = event.queryStringParameters?.q;
|
||||
const count = event.queryStringParameters?.count || "12";
|
||||
const offset = event.queryStringParameters?.offset || "0";
|
||||
|
||||
if (!query) {
|
||||
return {
|
||||
@@ -41,7 +42,7 @@ exports.handler = async (event) => {
|
||||
};
|
||||
}
|
||||
|
||||
const braveUrl = `https://api.search.brave.com/res/v1/web/search?q=${encodeURIComponent(query)}&count=${count}`;
|
||||
const braveUrl = `https://api.search.brave.com/res/v1/web/search?q=${encodeURIComponent(query)}&count=${count}&offset=${offset}`;
|
||||
|
||||
try {
|
||||
// Node 18+ has global fetch built in
|
||||
|
||||
Reference in new issue
Block a user