# CORS error builder component from @builder.io/react in localhost

**URL:** <https://forum.builder.io/t/cors-error-builder-component-from-builder-io-react-in-localhost/4836>\
**Category:** Technical Questions\
**Created:** [January 22, 2024, 4:19pm UTC](https://forum.builder.io/t/cors-error-builder-component-from-builder-io-react-in-localhost/4836 "2024-01-22T16:19:51Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [January 23, 2024, 1:19pm UTC](https://forum.builder.io/t/cors-error-builder-component-from-builder-io-react-in-localhost/4836/6 "2024-01-23T13:19:40Z")

</div>

Hello @Luiz,

When using the builder SDK, your code would look like the below

```auto
  useEffect(() => {
    builder
      .get("page-article", {
      limit: 100,
      query: {
        'data': { 
          "$or": [ 
            { 
              "title": { "$eq": "Qwik Blog" }
            }, 
            { 
              "title": { "$eq": "Partytown blog" }
            }
          ]
        }
      } 
      })
      .toPromise()
      .then((announcementBar) => setAnnouncement(announcementBar));
  }, []);

```

You should not be using the endpoint like the following `https://cdn.builder.io/api/v3/content/pible-page-article?apiKey=${process.env.NEXT_PUBLIC_BUILDER_API_KEY}&query.data.title.$options=i&&query.data.title.$regex=.*${searchTerm}.*&limit=20&omit=data.blocks)`

> [@REST API query $or doesnt seem to properly work](https://forum.builder.io/t/rest-api-query-or-doesnt-seem-to-properly-work/4835/4):
>
> Hello @djkenneth, Here is an example that is working for us const articles = await builder.getAll('blog-article', { // Include references, like the `author` ref options: { includeRefs: true }, limit: articlesPerPage, query: { 'data': { "$or": [{ "title": { "$eq": "Qwik Blog" } }, { "title": { "$eq": "Partytown blog" } }] } } })

> [@Fulltext search in custom fields](https://forum.builder.io/t/fulltext-search-in-custom-fields/157/2):
>
> Hey @aubergine - try leaving out the \*'s, e.g. query.data.myCustomField.$regex="searchText" E.g. you can query all of our docs that have the text “Builder” in them with this [https://cdn.builder.io/api/v2/content/docs-content?apiKey=YJIGb4i01jvw0SRdL5Bt&query.data.title.$regex="Builder"&fields=name](https://cdn.builder.io/api/v2/content/docs-content?apiKey=YJIGb4i01jvw0SRdL5Bt&query.data.title.%24regex=%22Builder%22&fields=name) You can make this a little nicer too by making the search case insensitive by also adding query.data.myCustomField.$options=i [https://cdn.builder.io/api/v2/content/docs-content?apiKey=YJIGb4i01jvw…](https://cdn.builder.io/api/v2/content/docs-content?apiKey=YJIGb4i01jvw0SRdL5Bt&query.data.title.%24regex=%22Builder%22&fields=name&query.data.title.%24options=i)

---

_[View the full topic](https://forum.builder.io/t/cors-error-builder-component-from-builder-io-react-in-localhost/4836)._
