meilisearch / awesome-meilisearch

A curated list of awesome Meilisearch resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Host for Meilisearch Javascript in a remote server (cannot use localhost)

adellinocasas opened this issue · comments

I'm deploing my app in a remote server. This is a Laravel app deployed in a VPS Ubuntu server and all services are workink well. The SSL certificate is set.
Meilisearch is running as a Service.
The app uses Meilisearch in two ways: via model (backend), and via Javascript (https://github.com/meilisearch/meilisearch-js). In this second case I cannot figure out what is the host.
In development mode was used 'http://127.0.0.1:7700' but in a remote server this is not possible:

const client = new MeiliSearch({
  host: 'http://127.0.0.1:7700',
  apiKey: 'masterKey',
})   

doesn't work!

I've tried:
. host: 'http://localhost:7700',
. host: 'http://the-app-ip:7700',
. host: 'http://the-app-ip',
. host: 'http://domain.xyz:7700',
. host: 'http://domain.xyz',

none of them work.
But using SSH and send a request:
curl -X GET 'http://localhost:7700/indexes/books_index/search' -H 'Authorization: Bearer abcdefghijlmopqrstuvxzw'
works!

What is the (for Javascript) host?
Thanks

Hi @adellinocasas, it looks like a Meilisearch support request, and not something related to Awesome Meilisearch.
I suggest moving this discussion to our support channel on Discord.