0.1.2 • Published 5 years ago

adonis-algoliasearch v0.1.2

Weekly downloads
50
License
MIT
Repository
github
Last release
5 years ago

Adonis AlgoliaSearch

This package is a wrapper on top of algoliasearch-client-javascript.

npm version license

Getting Started

Install the package using the adonis CLI.

> adonis install adonis-algoliasearch

Follow instructions that are displayed (or read them here).

Configure

Register the provider in start/app.js:

const providers = [
  ...
  'adonis-algoliasearch/providers/AlgoliaSearchProvider'
]

Add a configuration file in config/algolia.js. For example:

'use strict'

const Env = use('Env')

module.exports = {
  id: Env.get('ALGOLIA_APP_ID'),
  index: Env.get('ALGOLIA_APP_INDEX'),
  apiKey: Env.get('ALGOLIA_API_KEY')
}

Usage

const AlgoliaSearch = use('AlgoliaSearch')

const index = AlgoliaSearch.index('projects')

The index returned is the client.initIndex of algoliasearch, you have then access to all methods.

Thanks

Special thanks to the creator(s) of AdonisJS for creating such a great framework.

License

MIT

0.1.2

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago