mirror of
https://github.com/karust/openserp.git
synced 2026-08-05 16:53:54 +08:00
19 lines
505 B
JavaScript
19 lines
505 B
JavaScript
import { OpenSERP } from "@openserp/sdk";
|
|
|
|
// Hosted API instead? Get a key at https://openserp.org/dashboard/keys:
|
|
// const client = new OpenSERP({ apiKey: "<YOUR_API_TOKEN>" });
|
|
const client = new OpenSERP({ baseUrl: "http://localhost:7000" });
|
|
|
|
const { results } = await client.search({
|
|
engine: "google",
|
|
text: "open source search api",
|
|
region: "US",
|
|
lang: "EN",
|
|
limit: 10,
|
|
});
|
|
|
|
for (const item of results) {
|
|
console.log(`${item.rank}. ${item.title}`);
|
|
console.log(` ${item.url}`);
|
|
}
|