Add ssl option to MeiliSearch config
This commit is contained in:
parent
56ddb0555b
commit
8549b66a39
|
@ -87,6 +87,7 @@ redis:
|
|||
#meilisearch:
|
||||
# host: meilisearch
|
||||
# port: 7700
|
||||
# ssl: false
|
||||
# apiKey:
|
||||
|
||||
# ┌───────────────┐
|
||||
|
|
|
@ -39,11 +39,11 @@ export type Source = {
|
|||
collection?: string;
|
||||
bucket?: string;
|
||||
};
|
||||
|
||||
meilisearch: {
|
||||
host: string;
|
||||
port: number;
|
||||
apiKey?: string;
|
||||
ssl: boolean
|
||||
};
|
||||
|
||||
proxy?: string;
|
||||
|
|
|
@ -20,9 +20,10 @@ const hasConfig =
|
|||
const host = hasConfig ? config.meilisearch.host ?? "localhost" : "";
|
||||
const port = hasConfig ? config.meilisearch.port ?? 7700 : 0;
|
||||
const auth = hasConfig ? config.meilisearch.apiKey ?? "" : "";
|
||||
const ssl = hasConfig ? config.meilisearch.ssl ?? false : false;
|
||||
|
||||
const client: MeiliSearch = new MeiliSearch({
|
||||
host: `http://${host}:${port}`,
|
||||
host: `${ssl ? "https" : "http"}://${host}:${port}`,
|
||||
apiKey: auth,
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue