chore: meilisearch setup config

This commit is contained in:
Danny Avila 2023-03-22 10:23:55 -04:00
parent 73449d9ec6
commit 67161c983f
6 changed files with 17 additions and 12 deletions

View file

@ -6,13 +6,13 @@ const { MeiliSearch } = require('meilisearch');
// eslint-disable-next-line no-unused-vars
async function indexSync(req, res, next) {
try {
if (!process.env.MEILI_HOST || !process.env.MEILI_KEY || !process.env.SEARCH) {
if (!process.env.MEILI_HOST || !process.env.MEILI_MASTER_KEY || !process.env.SEARCH) {
throw new Error('Meilisearch not configured, search will be disabled.');
}
const client = new MeiliSearch({
host: process.env.MEILI_HOST,
apiKey: process.env.MEILI_KEY
apiKey: process.env.MEILI_MASTER_KEY
});
const { status } = await client.health();